Mark McIntyre said:
But /was/ it strictly conforming? I'm just asking.
I believe so. It was certainly intended to be.
Here's the program I posted:
#include <math.h>
int main (void)
{
int HUGE_VALF;
return 0;
}
I believe this is a strictly conforming C90 program, but not a
I guess my point was that C89 didn't reserve identifiers beginning
with capital H for future library direction did it?
No, it didn't, and yes, there are things in C99 that break strictly
conforming C90 programs. I think many things in C99 were compromises
between strict upward compatibility and esthetics. The _Bool keyword
avoids intruding on the user's name space, but surely if it had been
added to C in the beginning it would have been spelled bool.
In the case of HUGE_VALF (and HUGE_VALL), I think the committee
decided that making it look consistent with the existing HUGE_VAL was
more important than strict compatibility. Probably few, if any,
existing programs used HUGE_VALF as an identifier (unlike the fairly
common use of "bool"), and such uses are fairly easy to identify.
Absolutely. Which is partly why I reckon its meaningless to claim that
an implementation is "broken" if in "conforming mode" it doesn't or
indeed does do something or other.
I don't follow your reasoning. If a C90 implementation (in
"conforming mode") doesn't properly handle a strictly conforming
program, it's broken, and it's likely to mishandle a lot of real-life
programs as well. If we don't require at least that much conformance
among C implementations, we might as well not have a standard. On the
other hand, if a C90 implementation's only non-conformities are
attempts to implement C99 features, like adding HUGE_VALF to <math.h>,
I'm inclined to cut it a little slack. On the other other hand,
unless it implements all of C99, it should probably have a way to turn
off the C99 features.
There are some incompatible changes introduced by new standards, but
that only happens once a decade or so, and it's usually not too
difficult to work around the changes. If I were an absolute purist,
I'd insist on _HUGE_VALF, _Restricte, _Inline, and so forth, and all
valid C90 programs would be valid C99 programs with the same
semantics. But I'm not.