From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mumit Khan To: egcs@cygnus.com Subject: Unrecog attribute func handling change request + patch Date: Mon, 02 Feb 1998 17:14:00 -0000 Message-id: <9802022306.AA14407@modi.xraylith.wisc.edu> X-SW-Source: 1998-02/msg00094.html 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 * c-common.c (decl_attributes): Flag unrecognized attribute functions as warnings instead of as errors. Index: c-common.c =================================================================== RCS file: /usr/local/src/CVSROOT/egcs/gcc/c-common.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 c-common.c --- c-common.c 1997/12/20 18:10:20 1.1.1.1 +++ c-common.c 1998/02/02 23:00:21 @@ -645,8 +645,8 @@ decl_attributes (node, attributes, prefi is_scan = 1; else if (TREE_CODE (format_type) == IDENTIFIER_NODE) { - error ("`%s' is an unrecognized format function type", - IDENTIFIER_POINTER (format_type)); + warning ("`%s' is an unrecognized format function type", + IDENTIFIER_POINTER (format_type)); continue; } else Regards, Mumit -- khan@xraylith.wisc.edu http://www.xraylith.wisc.edu/~khan/