Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio fails to respond to disable/enable select code paths with Preprocessor __clang__ and/or __llvm__ #9

Closed
GloriousPtr opened this issue Dec 23, 2022 · 4 comments

Comments

@GloriousPtr
Copy link
Contributor

Issue:

#if defined(__clang__)
//this code won't execute
#endif
@zufuliu
Copy link
Owner

zufuliu commented Dec 31, 2022

@zufuliu
Copy link
Owner

zufuliu commented Dec 31, 2022

You probably handled _MSC_VER first which clang-cl also defines.

@GloriousPtr
Copy link
Contributor Author

You're right, it does work but Visual Studio fails to reflect it in the editor.
VS clang cl manages to correctly disables the code in the editor.

LLVM_v43:
image

LLVM - clang-cl (Visual Studio addon):
image

@GloriousPtr GloriousPtr changed the title Preprocessor __clang__ is not working Visual Studio fails to respond to disable/enable select code paths with Preprocessor __clang__ and/or __llvm__ Jan 3, 2023
@zufuliu zufuliu closed this as completed in 2734f50 Jan 3, 2023
@zufuliu
Copy link
Owner

zufuliu commented Jan 4, 2023

There may needs further work as Visual Studio Code Analysis or IntelliSense doesn't understand clang extension.
e.g. for https://github.com/zufuliu/notepad2/blob/main/src/EditAutoC.c
There are 45 errors with LLVM_v143 (more errors with LLVM (clang-cl)).
LLVM_v143
LLVM_clang-cl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants