Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!VAX1.CC.UAKRON.EDU!mcs.kent.edu!usenet.ins.cwru.edu!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown) Newsgroups: comp.std.c Subject: Re: Another sizeof question Message-ID: <1753.27303a6d@iccgcc.decnet.ab.com> Date: 1 Nov 90 20:08:29 GMT References: <13171@crdgw1.crd.ge.com> <1990Oct28.223702.27918@zoo.toronto.edu> <13294@crdgw1.crd.ge.com> Lines: 21 In article <13294@crdgw1.crd.ge.com>, volpe@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@iccgcc.decnet.ab.com Stan Brown, Oak Road Systems, Cleveland, Ohio, USA +1 216 371 0043