Article View: comp.sys.atari.st
Article #41156Re: Bug in TURBO-C V1.0
From: Roland Rambau
Date: Mon, 19 Feb 1990 09:21
Date: Mon, 19 Feb 1990 09:21
31 lines
1582 bytes
1582 bytes
hcj@lzsc.ATT.COM (HC Johnson) writes:
->> >Look at this C-code:
->> > #define MAX -32768
->> > main()
->> > {
->> > printf("1: %d\n", MAX);
->> > printf("2: %d\n", (int)MAX);
->> > }
->>
->> This is not a bug, its a feature. MAX is not a number, its an expression.
->> Thus, the evaluation of MAX is a long int. The first printf only prints
->K&R specify that constants are int's. Not a long int.
If I remember well, TC will give you a WARNING when it finds a constant
which is too long to fit in an int and therefor will be interpreted as long.
Corollary: Do not turn off any warning.
--
I know that You believe You understand what You think I said, but
I'm not sure You realize that what You heard is not what I meant.
Roland Rambau
rra@cochise.pcs.com, {unido|pyramid}!pcsbst!rra, 2:507/414.2.fidonet
--
I know that You believe You understand what You think I said, but
I'm not sure You realize that what You heard is not what I meant.
Technical Details
Message-ID:
<1990Feb19.092139.3131@pcsbst.pcs.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!tub!fauern!tumuc!guug!pcsbst!References:
<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!uunet!mcsun!unido!tub!fauern!tumuc!guug!pcsbst! From: roland@cochise.pcs.com (Roland Rambau) Newsgroups: comp.sys.atari.st Subject: Re: Bug in TURBO-C V1.0 Message-ID: <1990Feb19.092139.3131@pcsbst.pcs.com> Date: 19 Feb 90 09:21:39 GMT References: <8910270333.AA14741@cscwam.UMD.EDU> <0927891128429423@thelake.UUCP> <1990Feb14.173746.28244@agate.berkeley.edu> <1302@lzsc.ATT.COM> Sender: @pcsbst.pcs.com Organization: PCS Computer Systeme GmbH Lines: 31