: Re: __STDC__ and non-conforming ANSI C compilers

Mike Coffin mike at arizona.edu
Sat Jan 21 06:08:56 AEST 1989


Well, I'm bowing out.  It is clear to me that __STDC__ has no
practical application as far as porting code goes.  Compiler writers
that follow the letter of pANS will cause it to be undefined at the
slightest pretext, while others will set it to 1 if they consider
their nonconformance to be inconsequential.  Or maybe set it to 0,
or maybe "__ALMOST__," or "__PRETTY_CLOSE__."  Of course, there will
be as many definitions of "inconsequential" as there are compiler
writers.  (A really honest compiler writer would never turn on
__STDC__ until he was convinced his compiler had no bugs, I suppose.)

The practical significance is that if I actually put "#if __STDC__" in
a program, I would have to put "ifdef __almost_STDC__" in the #else
clause anyway.  And of course it would contain exactly the same code,
since I have no idea whether the compiler turned off __STDC__ for a
truly insignificant reason, or because this is really a FORTRAN
compiler named cc.

So, it's back to specifying compilation environments in the makefile.
I look forward to the day when there are no more "old" C compilers to
worry about, but I suppose by then we'll have a new standard to deal
with.


-- 
Mike Coffin				mike at arizona.edu
Univ. of Ariz. Dept. of Comp. Sci.	{allegra,cmcl2}!arizona!mike
Tucson, AZ  85721			(602)621-2858



More information about the Comp.std.c mailing list