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

2015-09-01 Thread sl at dataconnection dot com
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 

and I do "gcc -c -O1 ", 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.

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

2015-09-01 Thread sl at dataconnection dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67423

sl at dataconnection dot com changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from sl at dataconnection dot com ---
Apologies - I wasn't aware that 4.6.3 is out of support.  Perhaps it should be
removed from the list of valid versions in the drop down box to save confusion
in future?

I've found a box running 4.8.4 and agree that that doesn't have the same
problem (the ordering of the directives is the same, so presumably the compiler
is now more tolerant of their ordering)