This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning C vs C++


Robert Dewar <dewar@adacore.com> writes:

> Per Abrahamsen wrote:
>
>> The idea was that you would be sure to get all the (boolean) warnings
>> that are relevant for your project, and can give an explicit reason
>> for each warning you don't want.
>> It would be particularly useful when upgrading GCC, in order to be
>> sure you get the benefit of any new boolean warnings added.
>
> Of course any generally useful new boolean warnings would be
> included in -Wall.

Yeah, but I want the specifically useful warnings as well :-)

>From my Makefile:

	WARNING = -W -Wall -Wno-sign-compare \
		  -Wconversion -Woverloaded-virtual \
		  -Wsign-promo -Wundef -Wpointer-arith -Wwrite-strings 
#  -Wold-style-cast: triggered by header files for 2.95/woody
#  -Wmissing-noreturn: triggered by some virtual functions.
#  -Wmissing-prototypes -Wstrict-prototypes: Not C++ flags.

At some point I went through the manual and added all the warning
flags I could find, then commented out those that did not apply to my
coding style or environment.  Apparently there were six additional
flags that either didn't trigger any warnings on my code, or where I
found a rewrite made the code clearer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]