help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Any way to avoid applying compiler warnings to third-party headers?


From: Dan Katz
Subject: Any way to avoid applying compiler warnings to third-party headers?
Date: Fri, 22 Feb 2008 11:23:49 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)


Hi -

I've got a C++ project where I'm trying to keep things relatively
warning clean by compiling (with g++ v. 4.1) with the following
options: '-W -Wall -Werror -ansi'.  Of course, using -Werror forces me
to clean up warnings to get a compile.  This all worked fine until I
went to include a header file from a third-party library I don't
control (and cannot change) and found that the included header spawned
a variety of warnings.

So my question is: is there some way to apply the warnings analysis
from the compiler to my code but not to the code from the included
header?  I can imagine something like this:

------------------------------------
#define __NO_WARNINGS_FLAG

#include "third_party_header_with_warnings.hh"

#undef __NO_WARNINGS_FLAG



//My code goes here
------------------------------------


I'm sorry if this is a FAQ.  I did do some hunting in the gcc info
pages, but didn't see anything like this...

Thanks.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]