Another sizeof question

Stan Brown browns at iccgcc.decnet.ab.com
Fri Nov 2 07:08:29 AEST 1990


In article <13294 at crdgw1.crd.ge.com>, volpe at camelback.crd.ge.com (Christopher R Volpe) writes:
> 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. 

Chris, I haven't got a copy of the standard with me at this location,
but I think the index will help you.  Hint: ask the question in a
different way.  Don't look under sizeof, but under #if.  If memory
serves, you'll find references to a "restricted constant expression" and
if you'll follow that down you'll find that things involving program
variables and types  are _not_ part of it.  So it's not sizeof per se,
but any possible "argument" to sizeof that is the problem.

Sorry I don't have a section reference for you, but nobody else has 
posted one and the above at least should get you started.

Please do not attribute these remarks to any other person or company.
                                   email: browns at iccgcc.decnet.ab.com
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA    +1 216 371 0043



More information about the Comp.std.c mailing list