Of Standards and Inventions: A Cautionary Tale

Jerry Schwarz jss at hector.UUCP
Fri Apr 8 01:40:31 AEST 1988


In article <10949 at mimsy.UUCP> chris at mimsy.umd.edu (Chris Torek) writes:
>	On a machine with 32 bit |long|s and two's complement
>	arithmetic, what is the type of -2147483648 in the preprocessor?
>
>Since the preprocessor is required to follow the same rules as the
>compiler,  ...


Actually not.  Specifically, section 3.8.1, where it is discussing the
evaluation of the expression in a #if:

        "Then the usual arithmetic conversions apply during the
        evaluation of the expression, which takes place using
        arithmetic that has at least the ranges specified in section
        2.2.4.2."

My reading of this is that the ranges of the numbers used in evaluating
these expressions do not have to be the same as those used by the
target code.  



More information about the Comp.lang.c mailing list