Unrecog attribute func handling change request + patch
Jeffrey A Law
law@cygnus.com
Thu Feb 5 22:09:00 GMT 1998
In message < 9802022306.AA14407@modi.xraylith.wisc.edu >you write:
> While using a different stdio implementation that defines printf, etc
> as macros, I ran into a problem where GCC flags unrecognized attribute
> functions as errors. This seems rather too harsh, and I suggest warning
> the user instead; after all, this is an extension.
>
> To see the problem, use gas/as.h for example:
>
> #if (__GNUC__ >= 2) && !defined(VMS)
> /* for use with -Wformat */
> #define PRINTF_LIKE(FCN) void FCN (const char *format, ...) \
> __attribute__ ((format (printf, 1, 2)))
> #else
> /* ... */
> #endif
>
> SFIO (Safe/Fast I/O Library by David G. Korn and Kiem-Phong Vo) defines
> printf to be _stdprintf, so any code using this library and writing code
> like above, and there's lots of it, will fail.
>
> Here's a patch:
>
> Sun Feb 1 17:05:26 1998 Mumit Khan <khan@xraylith.wisc.edu>
>
> * c-common.c (decl_attributes): Flag unrecognized attribute
> functions as warnings instead of as errors.
I tend to agree that this shouldn't be an error... I've seen somebody
that disagreed... I've installed the patch, if we later think it should
be an error, we can always switch it back.
jeff
More information about the Gcc
mailing list