Re: Puzzled about persistent connection reuse

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 30 Jul 2003 08:49:28 +0200

On Wednesday 30 July 2003 08.19, Kinkie wrote:
> Duane Wessels <wessels@squid-cache.org> 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
Received on Wed Jul 30 2003 - 00:49:46 MDT

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