On Wednesday 30 July 2003 08.19, Kinkie wrote:
> Duane Wessels <[EMAIL PROTECTED]> writes:
> > You are missing arguments in these "printf" calls:
> >>     debug(17,3)("pconnPop: key is %s\n");
> >>     debug(17,3)("pconnPop: hptr is %p\n");

There is a compiler flag in GCC to catch these errors:

  -Wformat      Check calls to `printf' and `scanf', etc., to make sure
                that the arguments supplied have types appropriate to
                the format string specified, and that the conversions
                specified in the format string make sense.

                included in -Wall

The Squid sources is set up in such wat that this warning flag applies 
to the debug() macro and several other printf like Squid internal 
operations (debug, memBufPrintf, storeAppendPrintf etc, search for 
PRINTF_FORMAT_ in protos.h for a full list).

See http://devel.squid-cache.org/hno/build.sh for the script I use 
while compiling Squid-2.5. It sets a in my opinion quite decent set 
of warning flags allowing GCC to catch most silly errors..

Regards
Henrik

Reply via email to