side effects inside sizeof

Dave Martindale dmmartindale at watcgl.UUCP
Mon May 14 03:37:27 AEST 1984


Another interesting one is:

#define MSG "this is some string or other"

...

	l = sizeof(MSG);

In the compilers I'm familiar with, the string is dumped out into
the data space of the program, even though the compiler does evaluate
the size at compile time and the string will never be referenced.



More information about the Comp.lang.c mailing list