Another sizeof question

Christopher R Volpe volpe at camelback.crd.ge.com
Thu Nov 1 04:59:26 AEST 1990


In article <1990Oct28.223702.27918 at zoo.toronto.edu>,
henry at zoo.toronto.edu (Henry Spencer) writes:
|>In article <13171 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com
(Christopher R Volpe) writes:
|>>...The Bible says "sizeof" yields a constant integer,
|>>and that #if requires an integral constant expression, so I can't
|>>tell what's wrong...
|>
|>It's not clear which Bible you are reading. :-)  Is it the Old Testament
|>(K&R1), the New Testament (K&R2), or the New American Edition (ANSI)?
|>In a sufficiently modern and complete edition, you will find the rule
|>against this down in the fine print.

The "Bible" I was referring to is the American National Standard X3.159-1989.
I understand now what the rule is regarding sizeof, and why it is. 
But, could you or someone else point me to a reference in the Standard
that says that a constant expression in a preprocessor context cannot
contain sizeof? I'm sure it's in there but I can't find it. 

thanks,
Chris                       
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.std.c mailing list