GCC 2.95.2: Bugs in commandline options for C9X

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed Apr 5 16:55:00 GMT 2000


> This is for the released version.

Thanks for your bug report. I very much doubt that anything will
change in this area for 2.95, except perhaps for documenting these
options (c9x) as experimental. They certainly don't do what they
suggest, if for no other reasons that there is no standard named 'c9x'
- there is only 'C99' (or ISO/IEC 9899:1999). Of course, there are
other reasons - the implementation of that function is not complete.

> (1) The info files specify that there is an option -flang-isoc9x
>     which is however not recognized by the compiler.

Yes, that's a documentation error.

> (2) Using -std=c9x -ansi leads to a problem in creating the
>     call arguments for cpp:
> 
>        $ gcc -ansi -std=c9x -c file.c -o file.o
>        file.c:0: malformed option `-D __STRICT_ANSI__-trigraphs'

That is fixed in the mainline.

> (3) The index for info files does not really mention restrict;
>     the only place where one finds how to switch it on is
>     grepping in the info pages.

The mainline documentation has a node 'Restricted Pointers'.

> (4) It would be very nice if GNU C would create a define for
>     providing the `restrict' keyword; presently I'm using
> 
>     #if __STDC_VERSION__ >= 199901
>     #elif defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 91
>     #define restrict __restrict__
>     #else
>     #define restrict
>     #endif
> 
>     but I'm not altogether confident that this is a good solution.

No, that is not a good solution. I suggest to use autoconf, that is
well capable of dealing with such differences between compilers.

Regards,
Martin



More information about the Gcc-bugs mailing list