Reputation: 500
I have found plenty of answers on how to fix "include" errors/warnings by listing header directories in Properties -> C/C++ General -> Paths and Symbols -> Includes
. However, I am trying to find out if it is possible to suppress a warning for an included header that intentionally does not exist.
The file in this instance is named config.h
and it is generated from another file named config.h.in
after invoking the cmake
build tool. So there is no problem compiling the code. I just get the highlighted warning "Unresolved inclusion" in eclipse. I am looking to suppress this warning but don't know if it is possible.
I have tried the following but does not work:
#include "config.h" // @suppress("Unresolved inclusion")
Obviously not a severe problem, but would be nice to be able to suppress it.
Upvotes: 0
Views: 735
Reputation: 52749
I don't know of a way to suppress individual "Unresolved inclusion" annotations, but I can explain why @suppress
doesn't work for them.
There are two sources of error/warning annotations in Eclipse CDT:
Preferences | C/C++ | Code Analysis
.)@suppress
is a CodAn feature, and as such, it only applies to CodAn annotations.
I'm not aware of a similar feature for the second kind of annotation, beyond hiding this entire category in Preferences | General | Editors | Text Editors | Annotations | C/C++ Indexer Markers
.
Upvotes: 3