C preprocessor question

pedz at bobkat.UUCP pedz at bobkat.UUCP
Thu Feb 5 03:11:50 AEST 1987


In article <55 at umich.UUCP> jtr485 at umich.UUCP (Johnathan Tainter) writes:
>The #if is not going to evaluate the expression (((0) << 8) | (0))
>The #if takes an expression defined (recursively) by:
>an <expression> is
>	1) an integer string
>     or 2) (<expression> | <expression>)
>     or 3) (<expression> & <expression>)
>and nothing else.

This may be how it works but is not how it is defined.  The value
after the #if is suppose to be a constant expression.  Constant
expressions include almost all of the operators including << and
?:.  I refer you to K&R section 15 page 211.  Notice that it is
suppose to include sizeof which cpp can not cope with either.  i.e.
cpp is -----.
-- 
Perry Smith
pedz at bobkat
{ti-csl,infotel}!pollux!bobkat!pedz



More information about the Comp.bugs.4bsd.ucb-fixes mailing list