pr******@yahoo.com (rohit) wrote in message news:<93**************************@posting.google. com>...
Provided that its authors managed to understand the C99 standard.
Previous editions provided enough evidence that they missed some of the
finer points of C89...
how can we know that our compiler is in conformance of C89 or any
other standard.Is there a option/flag(like gcc -v gives the compiler
version) that says to which standard the compiler conforms to.
It's possible to find out whether the implementors claim that a
compiler conforms, by checking the documentation. That documentation
should also tell you what options you need to invoke to put your
compiler into conforming mode; the default mode is almost never fully
conforming. The "-ansi" option puts many compilers into a mode that
conforms to C89, or at least comes close to conforming. There's less
agreement about how to put compilers into conformance with the C99
standard.
However, it's impossible to know for certain that a compiler actuall
does conform to C89 (or C99). It's possible to test for
non-conformance by using various test suites. However, passing those
tests does not confirm conformance; no finite number of test cases can
cover every possible way an implementation can be non-conforming.
Also, a key component of a conforming implmentation is the
implementations documentation of those things the standard requires
each implementation to define. That document will be in some natural
language; as a result, automated testing is impossible with current
technology. Basically, it must be read by a human expert, who will try
to judge whether the implementors have adequately defined everything
they're required to define. Inherently, that will be a judgement call.
In other words, there is no royal road to determining conformance. The
simplest approach is to hope that when implementors claim that their
implementations are conforming, they're telling the truth, and to
complain about non-conformance if and when we detect it.