Re: [PATCH] Fix "identifier redeclared" compilation error with SUN cc
- From
- Martin Mares <mj@ucw.cz>
- Date
- Nov 20, 2007, 18:26 UTC
- Message-ID
- <mj+md-20071120.182204.515.nikam@ucw.cz>
- In-Reply-To
- <Pine.LNX.4.64.0711191847550.7957@bianca.dialin.t-online.de>
Hello!
Show 17 quoted lines
> #ifndef FLEX_ARRAY > -#if defined(__GNUC__) && (__GNUC__ < 3) > +#if defined(__GNUC__) > +#if (__GNUC__ < 3) > #define FLEX_ARRAY 0 > #else > #define FLEX_ARRAY /* empty */ > #endif > +#else > +/* more cases we know we can use 0 or empty can come here */ > +#endif > +#endif > + > +/* if still undefined, default to the safe, old fashioned way */ > +#ifndef FLEX_ARRAY > +#define FLEX_ARRAY 1 > #endif
Do we really want to use empty FLEX_ARRAY only for a new gcc? Shouldn't we test for C99 instead (__STDC_VERSION__ >= 199901L) and only if it isn't C99, choose between 0 and 1 depending on gccness of the compiler?
Have a nice fortnight
-- Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "First they ignore you. Then they laugh at you. Then they fight you. Then you win." -- Gandhi