POSIX, ANSI C, and __STDC__

Walter Murray walter at hpclwjm.HP.COM
Tue Jan 24 03:57:32 AEST 1989


Excerpts from D.F.Prosser's note:

>   cc -Xt ("transition", the default mode)
>	In those few places where ANSI C requires different semantics
>	(what the ANSI C Rationale calls QUIET CHANGES), a warning will
>	be issued, but the old semantics will be used.  The big example
>	is value- vs. unsigned-preserving promotion rules.  

>Thus, the (obvious) solution was to always pre-#define __STDC__, but
>have its value be 0 for -Xt and -Xa.

>I would propose that __STDC__ be #defined to be 0 in C compilation systems
>that meet all ANSI C conformance requires except for:
>  1. the inclusion of nonconforming "common extensions" listed in A.6.5,
>  2. not issuing otherwise required diagnostics when language extensions
>     are used, and/or
>  3. extra names declared or defined in standard headers.
 
Am I missing something, or is there a contradiction here?  Your
"transition" mode seems to violate your proposal, in that it defines
__STDC__ to be 0, yet follows unsigned-preserving promotion rules.

Walter Murray
----------



More information about the Comp.std.c mailing list