quotes inside #if 0

Larry Jones scjones at sdrc.UUCP
Sat Sep 9 07:26:41 AEST 1989


In article <32905 at ism780c.isc.com>, news at ism780c.isc.com (Marv Rubinstein) writes:
> Here is an example of *well defined* code that produces different results:
> 
>     Main()
>     {
>       unsigned char c=1;
>       if (c-2>0) <true-part> else <false-part>
> 
> The 'usual conversion rules' in K&R requires that the expression c-2 is
> unsigned and therfore the <true-part> executes.  The ANSI 'usual conversion
> rules' requires that the expression c-2 be signed and therefore the <false-
> part> executes.  This change and other similar ones are called 'quiet changes'

On the contrary, K&R has no concept of unsigned char, only
unsigned int.  That's why different implementers pick different
promotion rules for unsigned char and unsigned short, and thus
why X3J11 had to decide one way or the other.  Value preserving
promotion rules were not just made up on the spot!

> PS: I have heard that Unix release 5.4 uses two compilers.  One to compile
> Unix and one (ANSII) for new programs.  Does any one know if this is true?

AT&T compiler people are fond of saying that every command line
switch creates a new compiler.  I suspect that is the genesis of
the rumor you heard.
----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at SDRC.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150-2789             AT&T: (513) 576-2070
"I have plenty of good sense.  I just choose to ignore it."
-Calvin



More information about the Comp.lang.c mailing list