Re: More compiler warnings

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

It is committed to HEAD to force us to deal with these issues before 2.5
is released. Activated by a little C processing magic as it is a GNU C
extension...

Note: then changelog message got completely screwed up on the cvs
mailinglist, but is corrected in the CVS tree..

How it is done:

#if __GNUC__
#define PRINTF_FORMAT_ARG(pos) __attribute__ ((format (printf, pos, pos
+ 1)))
#else
#define PRINTF_FORMAT_ARG(pos)
#endif

extern void
_db_print(const char *,...) PRINTF_FORMAT_ARG(1);

extern void
httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char
*fmt,...) PRINTF_FORMAT_ARG(3);

Regards
Henrik

Robert Collins wrote:
>
> ----- Original Message -----
> From: "Henrik Nordstrom" <hno@marasystems.com>
> To: <squid-dev@squid-cache.org>
> Sent: Tuesday, October 23, 2001 10:05 AM
> Subject: More compiler warnings
>
> > Hi.
> >
> > Figured out how to enable GCC to check printf style arguments as used
> in
> > debug() and many other custom functions in Squid. This reveals a large
> > number of formatting errors, even on Intel boxes...
>
> Uhmm, how please?
>
> Rob
Received on Mon Oct 22 2001 - 19:15:33 MDT

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