Suppress “Unresolved Inclusion” Warning In Eclipse/CDT?












0














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.



unresolved-inclusion.png



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.










share|improve this question






















  • 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


















0














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.



unresolved-inclusion.png



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.










share|improve this question






















  • 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
















0












0








0







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.



unresolved-inclusion.png



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.










share|improve this question













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.



unresolved-inclusion.png



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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: 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




















  • 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


















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














1 Answer
1






active

oldest

votes


















1














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:




  1. 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.)

  2. 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.






share|improve this answer























  • Thank you. I really appreciate this clarification.
    – AntumDeluge
    Nov 21 at 2:34











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
});


}
});














draft saved

draft discarded


















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









1














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:




  1. 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.)

  2. 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.






share|improve this answer























  • Thank you. I really appreciate this clarification.
    – AntumDeluge
    Nov 21 at 2:34
















1














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:




  1. 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.)

  2. 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.






share|improve this answer























  • Thank you. I really appreciate this clarification.
    – AntumDeluge
    Nov 21 at 2:34














1












1








1






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:




  1. 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.)

  2. 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.






share|improve this answer














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:




  1. 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.)

  2. 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.







share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen