Machine specific predefined names

John Gilmore gnu at hoptoad.uucp
Sun Feb 21 22:25:30 AEST 1988


< 2) If so, will companies such as SUN, AT&T, DEC etc. predefine
<    names such as _Sparc, _U3b2, _Vax in their ANSII C compilers?
<    Note that doing so will also force change in some `existing
<    practices'.

scjones at sdrc.UUCP (Larry Jones) wrote:
> Hard to say for sure -- most of these companies have stated that they will
> provide conforming compilers, but they may just have a switch that gets
> rid of all the predefined identifiers rather than change them.  (Nothing
> says a compiler must be conforming by default!)

In general, good companies tend to opt for "not pissing off their
existing customer base", and Sun in particular has stated that their
product will continue to compile their customers' existing 4.2BSD based
code without change, as they slide in Sys V and such.  (Of course,
buggy code is not always going to port.)  I don't think they have
made an explicit committment to ANSI C or POSIX.

The really relevant statement quoted here is "nothing says a compiler
must be conforming by default".  GCC is only "fully conforming" if you
use the "-ansi" switch (it even enables the loathsome trigraphs), but
they don't expect anyone to use the switch.  If you really want an
error message for everything in your program that wouldn't run on ANSI
C, you have to say "-pedantic", which at least can be used sort of
like "lint".

There is some faint hope that a conforming ANSI C program could get by
without #ifdef FOURTEEN_CHAR_FILENAMES and such, but personally I doubt
it.  There are too many systems with C and not all of them get
everything right, even when they agree on right, which most of them
don't.  As an example, a conforming program probably can't make *any*
assumptions about the format of file names...  Therefore I doubt many
programs will be fully conforming.  They will depend on some sort of
externally defined names to specify the environment they are to be run
in.  Some of the more "pedantic" folks might have their Makefiles
specify "-D__SYSV_TTYS" but they will probably just do "-DSYSV_TTYS"
like they always have.
-- 
{pyramid,ptsfa,amdahl,sun,ihnp4}!hoptoad!gnu			  gnu at toad.com
		"Watch me change my world..." -- Liquid Theatre



More information about the Comp.lang.c mailing list