mitaki28 / vscode-clang

Completion and Diagnostic for C/C++/Objective-C using Clang
MIT License
128 stars 24 forks source link

"pragma once in main file" warning reported in header files #53

Open vittorioromeo opened 7 years ago

vittorioromeo commented 7 years ago

Even when #pragma once is used in an header file, the plugin incorrectly reports a diagnostic mentioning that it's being used in a main file. This issue has appeared (and has been fixed) in other editor plugins making use of clang. See:

A workaround would simply be to check the extension of the current fail and get rid of the diagnostic if it's an header.

phgroe commented 6 years ago

Moreover, the files using these headers are marked as being affected as well in the explorer sidebar, and so on and so forth. This can easily spread over a significant part of the workspace, which is quite irritating.

After working for a while, lots of files are marked and I never know if these are "real" warnings or just pragma once virus spreading.

FriskyDev commented 6 years ago

Looks like this has been sitting quite a while. Is there a way to at least disable this in the IDE?

cpterry commented 6 years ago

You can disable the warning by setting "clang.cxxflags": ["-Wno-pragma-once-outside-header"]