Path: utzoo!utgpu!watserv1!watmath!att!att!pacbell.com!ucsd!swrinde!zaphod.mps.ohio-state.edu!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.std.c Subject: Re: Another sizeof question Message-ID: Date: 2 Nov 90 19:43:04 GMT References: <13171@crdgw1.crd.ge.com> <492@taumet.com> <1990Nov2.034300.3065@tkou02.enet.dec.com> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 29 In-reply-to: diamond@tkou02.enet.dec.com's message of 2 Nov 90 03:43:00 GMT In article <1990Nov2.034300.3065@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: | In article meissner@osf.org (Michael Meissner) writes: | | >When I worked at Data General on the MV C compiler, I added sizeof | >support to the preprocessor (which is called as a coroutine from | >within the lexer). Because the preprocessor was built into the | >compiler, it involved no hand wringing. In fact, it would have been | >more work to disable sizeof, since the same parser was used to parse | >#if/#elif expressions as the normal expressions. | | "WOULD HAVE BEEN more work"? Do you mean that this work was not done? | As I understand the standard, a conforming processor is not allowed to | support this extension, even with a warning, even with a #pragma, etc. | A conforming processor is REQUIRED to substitute 0 for the identifier | sizeof (in an #if expression) if sizeof doesn't have a #defined value. Given that the feature in question was written BEFORE the first ANSI standards meeting took place (I know I wrote the feature, and was at the first meeting), I don't see how I should have been clarvoient to predict the twisty little turns that a future standard would take. Yes, to meet the standard nowadays the work would have to be done, to recognize and flag the use of sizeof. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Do apple growers tell their kids money doesn't grow on bushes?