Re: xcalloc question

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 16 Oct 2001 18:06:52 +0200

Adrian Chadd wrote:

> BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
> -Wcast-qual -Wchar-subscripts -Wconversion -Winline \
> -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings

I don't agree on all of them, but most. As discussed before I use at
least -Wall -Wmissing-prototypes, and do not accept that main Squid code
generates warnings using these.
(src/auth is currently excluded from this assertion as I don't have time
to clean up all helpers..).

-W good
-Wall very good. Always use this
-ansi good from a language construct side, but also changes system
library/includes to exclude some non-ANSI functions and isn't quite what
we want... (we use configure to find out what functions we can use)
-pedantic overly picky, and has the same issues as -ansi
-Wbad-function-cast don't know this one but it is probably a good one
-Wcast-align good to some extent, but mostly while auditing.
-Wcast-qual good, but there is valid uses of such casts
-Wchar-subscripts very good. should always use this
-Wconversion good
-Winline not much use unless you are manually optimizing the compiler
optimizations...
-Wmissing-prototypes very good, alvays use this
-Wnested-externs looks like a good one
-Wpointer-arith very good, should always use this
-Wredundant-decls good, but may fail with many system headers...
-Wshadow very good, should always use this
-Wstrict-prototypes very good, should always use this
-Wwrite-strings very good, should aim for using this, and const in
general

There are more good warning options if one cares to read the gcc
documentation.

--
Henrik
Received on Tue Oct 16 2001 - 10:05:54 MDT

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