Why does C standard consider each compiler flag a separate implementation?

Rick Schubert rns at se-sd.sandiego.NCR.COM
Thu Jun 16 02:12:29 AEST 1988


In article <2746 at ttrdc.UUCP> levy at ttrdc.UUCP (Daniel R. Levy) writes:
>  I also asked in con-
>junction with this if the proposed ANSI C standard had anything to say about
>flags to the compiler.
>
>Someone responded (I can't find the article now) and said that the proposed
>ANSI C standard considers each variation in the behavior of a compiler as
>influenced by, say, an external flag to be a separate implementation.
>
>Perhaps this language puts my proposal beyond the self-described scope
>of the proposed standard (does it really?) but my question now, is:  WHY does
>the proposed standard say this?

My understanding of this is that a compiler flag can have a profound effect
on the behavior of the compiler, <<potentially>> having the effect of
invoking a separate implementation.  For example, the compiler may have
something similar to:
		if (strcmp(*argv,"-x") == 0)
			compiler1();
		else
			compiler2();
where compiler1() and compiler2() <<are>> separate implementations.
This is an extreme example, but various flags can have varying degrees
of effect on the compiler.  Even though most flags will not affect the
compiler on issues related to conformance to the Standard, the potential
is there, and it would be difficult for the Standard to specify what
types of flags were allowed and what types weren't.  I think this is
what Doug Gwyn was getting at when he responded:
: What would you prefer that it say?
: I bet you can't word your notion in a form acceptable for use in a standard.
>
>De-mystify me, please?
Are you de-mystified?

-- Rick Schubert (rns at se-sd.sandiego.NCR.COM)



More information about the Comp.std.c mailing list