side effects inside sizeof

Henry Spencer henry at utzoo.UUCP
Thu May 17 08:00:19 AEST 1984


Joey Duhon says, in part:

   Having read all the speculation about what "sizeof expression" should
   present, I thought I'd read the manual ("The C Programming Language,"
   Kernighan and Ritchie).

   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).

All this is quite true, and I was aware of page 126.  But the definition
of the language is the C Reference Manual, ***NOT*** the textbook that
happens to precede one particular edition of it.  All page 126 tells us
is what DMR *intended*, but that's been clear all along anyway.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list