weird C behavior
Joseph S. D. Yao
jsdy at hadron.UUCP
Fri Mar 28 13:48:16 AEST 1986
In article <559 at umcp-cs.UUCP> chris at umcp-cs.UUCP (Chris Torek) writes:
>In article <330 at hadron.UUCP> jsdy at hadron.UUCP (Joseph S. D. Yao) writes:
>>>On a 16 bit machine, this should read
>>> printf("%ld\n", 36864); [me]
>>Passed arguments should always be passed as an "int", I do believe.
> ... According to K&R, a constant that
>is too big to be an `int' is automatically considered a `long'; ...
>For you ANSI C buffs, I quote from a year-old draft (the latest I
>could find), section C.1.3.2, `Integer constants':
Moral: check your sources (no pun intended?). We analysed this
"weird behaviour" the same way; but I was wrong in calling it a
compiler error.
End of discussion.
--
Joe Yao hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}
More information about the Comp.lang.c
mailing list