Path: utzoo!attcan!uunet!world!decwrl!wuarchive!zaphod.mps.ohio-state.edu!rpi!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.std.c Subject: Re: Another sizeof question Message-ID: <13294@crdgw1.crd.ge.com> Date: 31 Oct 90 17:59:26 GMT References: <13171@crdgw1.crd.ge.com> <1990Oct28.223702.27918@zoo.toronto.edu> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 25 In article <1990Oct28.223702.27918@zoo.toronto.edu>, henry@zoo.toronto.edu (Henry Spencer) writes: |>In article <13171@crdgw1.crd.ge.com> volpe@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@crd.ge.com