ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I know with gcc you can suppress certain types of warnings by using -Wno-error-errorType to suppress errors of type "errorType". But how do you suppress one specific warning. Is there a way to do this with gcc - I understand you can do it with Visual C++ by using pragma then the unique warning id number. But in gcc i don't see unique warning numbers??
I'm not really sure, but why would you need to suppress a warning? It's just a warning, not an error, and later on the bug that the warning is trying to warn you about may sneak into the code elsewhere. If you've blocked that warning, you won't know it until difficult to track logic errors appear.
I understand you're concern. The requirement is to have warning free nightly builds and the warning is coming from a 3rd party package so being able to suppress it is desireable. Can anyone give an example of how to use gcc pragmas?
Googling around, it seems that gcc doesn't like the pragma. If there's a way to do this with a pragma, they aren't telling. :-) All the sources I can find say to do it with the -Wno-something flags on the compile command. What warning is being given? Can it be covered with a -Wno flag?
I agree it seems they had it long ago, then decided it was bad, and now are somewhat making it more available with gcc 3.4.0. No, the -Wno-error doesn't cover it because then it'll supress all warnings of that type not just the ones for that particular class (i think..).
Hrm, that may be the compromise you have to live with. Alternatively, you could just wrap gcc in a little awk script that just strips that warning out. After all, a warning is really nothing more than a line on the screen.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.