How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]

2007-03-28 Thread Dave Korn
On 25 March 2007 07:37, Andrew Pinski wrote: On 3/24/07, Brian Dessent wrote: Dave Korn wrote: # 405 /usr/include/stdio.h 3 4 [ Which is from newlib (libc/include/stdio.h) if anyone reading this doesn't have a Cygwin system handy. ] static __inline__ int __sgetc_r(struct _reent

Re: How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]

2007-03-28 Thread Ian Lance Taylor
Dave Korn [EMAIL PROTECTED] writes: So, am I correct to believe that we need to use plain 'inline' for c99 after gcc 4.4, and 'extern inline' before that? That is, I think I need to write a test that looks like... #if ((__GNUC__ 4) || ((__GNUC__ == 4) (__GNUC_MINOR__ = 4))) \

RE: How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]

2007-03-28 Thread Dave Korn
On 28 March 2007 15:14, Ian Lance Taylor wrote: Dave Korn [EMAIL PROTECTED] writes: So, am I correct to believe that we need to use plain 'inline' for c99 after gcc 4.4, and 'extern inline' before that? That is, I think I need to write a test that looks like... #if ((__GNUC__ 4)

RE: How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]

2007-03-28 Thread Dave Korn
On 28 March 2007 15:14, Ian Lance Taylor wrote: It's simpler than that. I defined new preprocessor macros specifically to avoid this complexity. Here is one approach that should work; #ifdef __GNUC_STDC_INLINE__ #define ELIDABLE_INLINE inline #else #define ELIDABLE_INLINE extern inline

Re: How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]

2007-03-28 Thread Ian Lance Taylor
Dave Korn [EMAIL PROTECTED] writes: To allow for non gcc compilers, I think I should in fact say #if defined(__GNUC__) !defined(__GNUC_STDC_INLINE__) #define ELIDABLE_INLINE extern inline #else #define ELIDABLE_INLINE inline #endif ... i.e., if using gcc without the new behaviour,