I like to compile my code with -Wall, and sometimes even -pedantic. It’s partly a style thing, and partly the fact that it does occasionally emit very, very useful warnings (such as using = rather than ==).
However, the writers of some of my headers are clearly not such sticklers. Compiling with either of the two warning levels yields a tremendous mess of output, completely defeating the purpose of compiling that way in the first place.
So how can I make my compiler ignore those warnings?
Alternatively to JS Bangs’ answer, you can have GCC treat them as system headers, which disables all warnings (excepting
#warningdirectives) for those headers.If the
-isystemswitch is unhelpful, you can wrap all of the offending headers with simpler headers that contain only the appropriate line: