This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c/67423] New: printf.h does not compile with O1 or above


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67423

            Bug ID: 67423
           Summary: printf.h does not compile with O1 or above
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sl at dataconnection dot com
  Target Milestone: ---

If I have a test file consisting of

#include <printf.h>

and I do "gcc -c -O1 <test file>", the compile fails with 

/usr/include/printf.h:116:68: error: expected initializer before ÃthrowÃ
/usr/include/printf.h:122:70: error: expected initializer before ÃthrowÃ

Either the __wur and __THROW #defines on the following rows

--------------------------------
...
extern int register_printf_modifier (__const wchar_t *__str) __wur __THROW;


/* Register variable argument handler for user type.  The return value
   is to be used in ARGINFO functions to signal the use of the
   type.  */
extern int register_printf_type (printf_va_arg_function __fct) __wur __THROW;
...
--------------------------------

are the wrong way round or gcc is not sufficiently tolerant on ordering here.

Can you recommend the safest workaround for this problem?  At the moment I'm
putting in an override 

#define __wur

and putting up with the compile warnings.

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