Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!aplcen!ginosko!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: quotes inside #if 0 Keywords: ANSI, comments Message-ID: <792@sdrc.UUCP> Date: 8 Sep 89 21:26:41 GMT References: <2014@munnari.oz.au> <10935@smoke.BRL.MIL> <3626@yunexus.UUCP> <32905@ism780c.isc.com> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 32 In article <32905@ism780c.isc.com>, news@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) else > > The 'usual conversion rules' in K&R requires that the expression c-2 is > unsigned and therfore the executes. The ANSI 'usual conversion > rules' requires that the expression c-2 be signed and therefore the 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@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