Tim Rentsch said:
Keith Thompson said:
No, that isn't the case. A C99 compiler need not conform to C90, and
need not even have a option to do so. It may even be impossible to
conform to both simultaneously, though I'd have to think about that for
a while to be sure.
Hmm. I think it would be possible for a compiler to conform to both C90
and C99, though it would be ugly. [snip elaboration]
Can't be done, because there are programs that are well-defined
in both languages but have different semantics in the two cases.
I'd be interested in seeing an example.
Reviewing the list of changes from C90 in paragraph 5 of the Forward to
n1256.pdf, it seems as though most of the differences took the form of
giving defined behavior to code that was a syntax error, a constraint
violation, or had undefined behavior in C90. In a few cases the opposite
occurred. None of those cases is a barrier to simultaneous conformance:
give the constructs the meaning required by one version of the standard,
after generating the diagnostic (if any) required by the other version.
It requires more knowledge than I possess about C90 to determine whether
any of these cases would actually prevent simultaneous conformance:
Is there any context where UCNs are allowed in C99, where they would
also have been permitted in C90 with a conflicting interpretation?
It merely says that the integer constant type rules and the promotion
rules change. Is there any case where those changes could not be
rendered invisible by suitable choices for the values of *_MAX from
<limits.h>?