This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 2.95.2: Bugs in commandline options for C9X
> > (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.
Autoconf is a solution for configuring a package before compiling it.
But it cannot help with other problems.
For example, imagine a standard C library that is distributed as a
separate product, not in sync with any compiler. In that case, if the
library maintainers want to upgrade it to be compliant with C99, they
must use `restrict' in the headers supplied with the library. But
this means that the new library version forces its users to upgrade
the compiler as well, which is not very nice, since some of the
library users might not need any of the C99 features, just the
improvements in other parts of the library.
Does GCC offer any solutions for these kinds of problems? If not, I
think it should.
Just to clarify: the library I have in mind is distributed in binary
form, and most its users are not expected to compile it on their
machines. So autoconf cannot solve this.