side effects inside sizeof
Henry Spencer
henry at utzoo.UUCP
Wed Jun 20 08:42:29 AEST 1984
I fully agree that my side-effects-of-sizeof program was an abomination,
and I wasn't "grumbling" about the second printf producing a "1" so much
as I was grumbling about the fact that the manual doesn't actually permit
this (eminently sensible) behavior. The compilers are *not* broken, the
manual is.
I'm told that the draft ANSI C standard now includes specific words to
the effect that sizeof is fully compile-time and side effects don't
occur. Good.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
More information about the Comp.lang.c
mailing list