Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Denver Mods 4/2/84) 6/24/83; site drutx.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!ihnp4!drutx!opus From: opus@drutx.UUCP (ShanklandJA) Newsgroups: net.lang.c Subject: Re: side effects inside sizeof Message-ID: <318@drutx.UUCP> Date: Tue, 15-May-84 09:25:07 EDT Article-I.D.: drutx.318 Posted: Tue May 15 09:25:07 1984 Date-Received: Wed, 16-May-84 04:52:29 EDT References: utzoo.3844 <283@idis.UUCP> <502@ihuxj.UUCP> Organization: AT&T Information Systems Laboratories, Denver Lines: 25 Joey Duhon (ihuxj!duhon) writes: On page 126 we read "The expression sizeof(object) yields an integer equal to the size of the specified object. ... The object can be an acutual variable or array or structure, ..." I don't see anything here about other expressions. The confusion seems to be over the reference manual which indicates that the grammar will accept "sizeof expression" syntactically. This is obviously a shortcut for the compiler writer(s). However, the semantic interpretation is explained above(p.126). This all seems clear to me. Good point, but we've still got a compiler problem here, I'd say. If sizeof( x++ ) is really a semantic error, then the compiler ought to be complaining about it, rather than quietly doing its own thing, whatever that may be. Undeclared variables are also permitted by the C syntax -- that is, they are a semantic error -- but I imagine howls would be heard far and wide (mine certainly would be) if a C compiler issued no error message for an undeclared variable, and issued code that dumped core the first time that variable was referenced or assigned to. Jim Shankland ..!ihnp4!druxy!opus