This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unrecog attribute func handling change request + patch


  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]