Subject: Re: small hack
To: None <perry@piermont.com>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: tech-userlevel
Date: 09/23/1998 18:31:16
On Wed, Sep 23, 1998 at 11:27:02AM -0400, Perry E. Metzger wrote:
>
> We should also make sure gcc is taught how to find bugs in
> its use (and in that of the warn* and err* functions if that isn't
> already done.)
Something like what I've added below ought to do the trick,
under modern gcc/egcs. (Yes, the format attribute is a Wonderful
Thing for those custom variants on printf I manage to keep
writing!)
...
> > void
> > #ifdef __STDC__
> > usage(int eval, const char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
> > #else
> > usage(va_alist)
> > va_dcl
> > #endif
...
Brian
--
"In the king's pine tree, the bagworm is one-eyed."