Article View: comp.sys.atari.st
Article #41007Re: Bug in TURBO-C V1.0
From: Stephen Jacobs
Date: Fri, 16 Feb 1990 15:08
Date: Fri, 16 Feb 1990 15:08
13 lines
1566 bytes
1566 bytes
My two cents on the behavior of the 'constant' -32768 in C. If something is
#define ed as -32768, remember that that means a _textual_ substitution will
be made wherever that thing appears (in contrast to a numeric substitution).
So the normal rules for integer constants apply (rather than some special
rule that might apply to preprocessor actions: the preprocessor action is
simple). Integer constants don't have leading signs. -32768 gives the
result of applying unary minus to the integer constant 32768. And on a 16
bit model compiler, there isn't an integer 32768. So the value of -32768 is
free to vary depending on context. One hopes a warning message is generated
(it is in Mark Williams C). Frankly, -32768 is such a convenient value for
flags on a 2-s complement machine, that I'd like integer constants to have
an optional leading sign, but it isn't defined that way.
Steve J.
Technical Details
Message-ID:
<1990Feb16.150818.18727@chinet.chi.il.us>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!usc!apple!motcsd!motsj1!mcdchg!chinet!sajReferences:
<8910270333.AA14741@cscwam.UMD.EDU> <0927891128429423@thelake.UUCP> <1990Feb14.173746.28244@agate.berkeley.edu> <1302@lzsc.ATT.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!usc!apple!motcsd!motsj1!mcdchg!chinet!saj From: saj@chinet.chi.il.us (Stephen Jacobs) Newsgroups: comp.sys.atari.st Subject: Re: Bug in TURBO-C V1.0 Summary: I don't like it, but K&R constants don't have signs Message-ID: <1990Feb16.150818.18727@chinet.chi.il.us> Date: 16 Feb 90 15:08:18 GMT References: <8910270333.AA14741@cscwam.UMD.EDU> <0927891128429423@thelake.UUCP> <1990Feb14.173746.28244@agate.berkeley.edu> <1302@lzsc.ATT.COM> Reply-To: saj@chinet.chi.il.us (Stephen Jacobs) Organization: Chinet - Chicago Public Access UNIX Lines: 13