K
Keith Thompson
zebedee said:Keith said:If gcc is invoked with "-ansi" (or equivalently "-std=c89") and a few
other options, it's conforming as far as I know. More precisely, I'm
not aware of any conformance failures.
All software has bugs. I believe gcc is *intended* to be a
conforming
C90 compiler. If there are any major areas in which it fails to
conform to C90, I'd be intererested in hearing about them.
There are many code snippets I could give where GCC fails compile-time
conformance (never mind run-time). Compile time is my personal area
of interest, as I'm writing a C front end of my own. I have worked on
GCC in the past; it is curious that so many people believe it is
conforming, though I admit it's pretty good.
Most could be fixed with small changes in GCC, i.e. they can be
considered bugs or oversights. One class is harder to fix (and shared
by the EDG front end; it's in GCC's bug database . The area where
GCC has the most difficulty, and is least easily fixed, is in
expression handling, particularly constant expressions and folding.
These will not, to the best of my knowledge, be fixed any time soon.
As I said I could, but won't, provide many snippets. One is sufficient
to prove my claim, so note that GCC fails to diagnose the constraint
violation in the following translation unit:
int n = 0, p[n * 0 + 1];
Ok, there's a bug. As I wrote above, all software has bugs.
<http://gcc.gnu.org/bugzilla/> shows 3803 open bugs; I don't know what
proportion of those are related to C90 standard conformance.
Strictly speaking, any compiler with a bug is not a conforming
compiler. By that criterion, I doubt that there has ever been a
conforming compiler for any language.
But that's not what I asked about. I asked if there are any *major
areas* in which gcc fails to conform to C90.
There are clearly areas in which gcc fails to conform to C99;
<http://gcc.gnu.org/c99status.html> is a summary of the current
status. Is there, or should there be, a similar table for C90?