Unomitted frame pointers
Thomas R. Truscott
trt@cs.duke.edu
Fri Dec 10 16:55:00 GMT 2004
> write (2, HELLOSTRING, strlen(HELLOSTRING));
People sometimes mismatch the string names, e.g.:
write (2, HELLOSTRING, strlen(JELLOSTRING));
^
To reduce that hazard we have a macro:
#define TEXTARG(s) s, (int)strlen(s)
write (2, TEXTARG (HELLOSTRING));
But it looks odd, and people don't use it as much as they could.
Tom Truscott
P.S. here is another thing gcc misses:
memcpy("hi", p, 2); /* "cannot modify string literal" */
More information about the Gcc
mailing list