GCC -W flags

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 17 Oct 2001 23:03:53 +0200

All Squid code is now tested and compiles cleanly with the following
combination of GCC -W flags

   -Werror
   -Wall
   -Wpointer-arith
   -Wcast-align
   -Wwrite-strings
   -Wstrict-prototypes
   -Wmissing-prototypes
   -Wmissing-declarations
   -Wcomments

and all helpers is tested with at least

   -Werror
   -Wall
   -Wpointer-arith
   -Wcast-align
    
As a result, these options is now included each time I build Squid,
trapping any violations against these.

The following GCC -W options have been rejected as these warn on
constructs which makes sense in Squid.

   -Wbad-function-cast (this warning is plain stupid)
   -Wnested-externs (we have a couple of ugly hacks making good use of
this)
   -ansi (we need library extensions outside ANSI C)
   -pedantic (glibc headers cannot surive this)
   -Wconversion (we require prototypes, don't like overly typecasting)
   -Wcast-qual (we sometimes need to be able to get rid of const)

A reasonable long term goal is to also pass the following options in
order of preference:

   -Wshadow
   -Wredundant-decls
   -Wsign-compare
   -W
   -Wnested-externs (in a clean manner, not simply making them global)

and maybe additional useful options I have forgotten os supported by
later GCC versions than mine..

Regards
Henrik
Received on Wed Oct 17 2001 - 15:08:03 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:33 MST