Path: utzoo!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.arch Subject: Re: Shifting question Message-ID: <11651@steinmetz.ge.com> Date: 26 Jul 88 13:15:45 GMT References: <705@bnr-rsc.UUCP> <11556@steinmetz.ge.com> <11606@steinmetz.ge.com> <12638@mimsy.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 68 In article <12638@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: | In article <11606@steinmetz.ge.com> davidsen@steinmetz.ge.com | (William E. Davidsen Jr) writes: | >reading the [draft proposed X3J11 C] standard certainly seems to | >say [that sizeof is allowed in preprocessor expressions] at this time. | >... If sizeof is NOT legal in preprocessor directives, then the standard | >should be clarified, ... | | It is explicitly disallowed in one tiny clause in the second most recent | draft. (I have not yet had time to look at the most recent draft.) Actually I believe that the clause you mention was deleted. Here is a message and my reply: ================================================================ From: dmr@research.att.com Date: Tue, 26 Jul 88 01:15:16 EDT To: wedu@ge-crd.arpa Subject: #if sizeof p. 87, line 24-25 of the Jan draft (the constraint in 3.8.1) say "Additional restrictions apply.... The expression ... shall not contain a sizeof operator...." Dennis Ritchie ==== Subject: Re: #if sizeof Date: 26 Jul 88 08:36:16 EDT (Tue) From: davidsen@crdos1.UUCP (Wm E. Davidsen) Thanks for the reference from the January draft. The v3 draft in 3.8.1 constraints says: The expression that controls conditional inclusion shall be an integral constant expression except that: it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below{74}; and it may contain unary operator expressions of the form: defined identifier or defined ( identifier ) which evaluate to 1 if the identifier is currently defined as a macro name (that is, if it is predefined or if it has been the subject of a #define preprocessing directive without an intervening #undef directive with the same subject identifier), 0 if not. Each preprocessing token which remains after all macro replacements have occured shall be in the lexical form of a token. ---------------------------------------------------------------- 74 Because the controlling constant expression is evaluated during translation phase 4, all identifiers either are or are not macro names - there simply are no keywords, enumeration constants, and so on. Whatever was in the January draft seems to be removed. ================================================================ I can believe that this is a typo, although I would rather believe that sizeof is now allowed. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me