Re: PATCH: gcc3.x __FUNCTION__ fix



On 2002.01.05 19:13 Ali Akcaagac wrote:
> On Sat, 2002-01-05 at 18:57, Pawel Salek wrote:
> > In other words, using __func__ would mean we require C-99 compatible
> > compiler, which is not something I would like to do at the moment (I
> > believe gcc is the only available compiler that implements this
> standard),
> > unless there is no other way to make gcc-3.0 compile balsa.
> 
> well, the problem is gcc 3.0.3 is complaining during compile e.g. if you
> use -Werror it STOPS and spits out (warnings are beeing taken as errors)
> so i recommend to implement a check for explicit gcc3.0.3 in this case
> we need to implement some ifdef to check what compiler is used otherwise
> you may earn a lot of rants by people using gcc3.0.3 i recommend looking
> into the galeon sources to figure out their way of compiler guessing.

What about
#ifdef C99
#define __FUNCTION__ __func__
#endif
or conversely:
#ifndef C99
#define __func__ __FUNCTION__
#endif
?

I tried to make a test using __STDC_VERSION__ that according to the doc 
should expand to the implemented standard date but my gcc apparently does 
not define it.

int main()
{
   printf("V=%ld\n", __STDC_VERSION__ );
   return 0;
}

-pawel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]