IMP:GNU extensions on gcc 3.2

Tolga Dalman ates100@web.de
Mon Jan 13 12:52:00 GMT 2003


hello, 

On Mon, 13 Jan 2003 15:34:14 +0530 Sayali Surve <ssurve@versant.com> wrote:

> 
> Hello,
> 
> I have upgraded gcc version from 2.96 to gcc 3.2.
> I have got following queries:
> 
> 1.    I am using a C++ front end compiler which does not support GNU
> extensions.
> Hence, the compilation flags  -U__GNUC__, -U__GNUG__ are used.
> But, it gives me following errors which I think, should not be seen at
> all
> as we are undefining the GNUC flags:
> 
> "/usr/local/gcc.3.2/include/c++/3.2/bits/concept_check.h", line 52:
> error:
>           expected an identifier
>   #define __glibcpp_function_requires(...)
>                                       ^
> "/usr/local/gcc.3.2/include/c++/3.2/bits/stl_alloc.h", line 928: error:
>           invalid combination of type specifiers
>     extern template class allocator<char>;
> 
> How can I get rid of the above errors ?? Please note that
> I do not want to use GNU extensions at all.
> 

pass -D_POSIX_SOURCE or -D_ISOC99_SOURCE to your compiler, if you are using
glibc aswell. this will cause the glibc to behave either POSIX or ISO C99
conform.
(there are even more flags, you might want to look at the "NOTES" file in the
glibc doc directory...)


> 2.    Where are the built-in functions e.g. __builtin_strstr,
> __builtin_strpbrk etc.
> are defined??
> Is there any way or any flag so as to not include built-in functions??
> 

actually, there's a "-fno-builtin-function" option for gcc, but there's also
a note in the man-page about c++. there you can read, this option is 
always in effect for c++ source. 

good luck!

brg, 
Tolga Dalman



More information about the Gcc-help mailing list