Suppress “Unresolved Inclusion” Warning In Eclipse/CDT?
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.
c++ eclipse eclipse-cdt
add a comment |
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.
c++ eclipse eclipse-cdt
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
Right, that's what I mean: runcmake
, point Eclipse to the right directory, and all is well.
– HighCommander4
Nov 21 at 2:13
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
1
One thing to keep in mind, is that the contents ofconfig.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.
– HighCommander4
Nov 21 at 4:50
add a comment |
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.
c++ eclipse eclipse-cdt
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.
c++ eclipse eclipse-cdt
c++ eclipse eclipse-cdt
asked Nov 21 at 1:39
AntumDeluge
789
789
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
Right, that's what I mean: runcmake
, point Eclipse to the right directory, and all is well.
– HighCommander4
Nov 21 at 2:13
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
1
One thing to keep in mind, is that the contents ofconfig.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.
– HighCommander4
Nov 21 at 4:50
add a comment |
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
Right, that's what I mean: runcmake
, point Eclipse to the right directory, and all is well.
– HighCommander4
Nov 21 at 2:13
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
1
One thing to keep in mind, is that the contents ofconfig.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.
– HighCommander4
Nov 21 at 4:50
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
Right, that's what I mean: run
cmake
, point Eclipse to the right directory, and all is well.– HighCommander4
Nov 21 at 2:13
Right, that's what I mean: run
cmake
, point Eclipse to the right directory, and all is well.– HighCommander4
Nov 21 at 2:13
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
1
1
One thing to keep in mind, is that the contents of
config.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.– HighCommander4
Nov 21 at 4:50
One thing to keep in mind, is that the contents of
config.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.– HighCommander4
Nov 21 at 4:50
add a comment |
1 Answer
1
active
oldest
votes
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:
- Ones that come from the Code Analysis (CodAn) module. This includes semantic errors, and warnings. (You can see a list of these in
Preferences | C/C++ | Code Analysis
.) - Ones that come directly from the indexer. This includes syntax errors, and preprocessor errors (including unresolved inclusion errors).
@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
.
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53404143%2fsuppress-unresolved-inclusion-warning-in-eclipse-cdt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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:
- Ones that come from the Code Analysis (CodAn) module. This includes semantic errors, and warnings. (You can see a list of these in
Preferences | C/C++ | Code Analysis
.) - Ones that come directly from the indexer. This includes syntax errors, and preprocessor errors (including unresolved inclusion errors).
@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
.
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
add a comment |
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:
- Ones that come from the Code Analysis (CodAn) module. This includes semantic errors, and warnings. (You can see a list of these in
Preferences | C/C++ | Code Analysis
.) - Ones that come directly from the indexer. This includes syntax errors, and preprocessor errors (including unresolved inclusion errors).
@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
.
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
add a comment |
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:
- Ones that come from the Code Analysis (CodAn) module. This includes semantic errors, and warnings. (You can see a list of these in
Preferences | C/C++ | Code Analysis
.) - Ones that come directly from the indexer. This includes syntax errors, and preprocessor errors (including unresolved inclusion errors).
@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
.
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:
- Ones that come from the Code Analysis (CodAn) module. This includes semantic errors, and warnings. (You can see a list of these in
Preferences | C/C++ | Code Analysis
.) - Ones that come directly from the indexer. This includes syntax errors, and preprocessor errors (including unresolved inclusion errors).
@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
.
edited Nov 21 at 4:48
answered Nov 21 at 2:21
HighCommander4
26.5k1797161
26.5k1797161
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
add a comment |
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
Thank you. I really appreciate this clarification.
– AntumDeluge
Nov 21 at 2:34
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53404143%2fsuppress-unresolved-inclusion-warning-in-eclipse-cdt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why not just point Eclipse to where the generated file lives?
– HighCommander4
Nov 21 at 2:09
That would only work if the file has been generated.
– AntumDeluge
Nov 21 at 2:12
Right, that's what I mean: run
cmake
, point Eclipse to the right directory, and all is well.– HighCommander4
Nov 21 at 2:13
That is definitely an option.
– AntumDeluge
Nov 21 at 2:35
1
One thing to keep in mind, is that the contents of
config.h
might include macro definitions that Eclipse should know about to accurately parse the rest of your code.– HighCommander4
Nov 21 at 4:50