This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Unomitted frame pointers
- From: "Thomas R. Truscott" <trt at cs dot duke dot edu>
- To: schwab at suse dot de (Andreas Schwab)
- Cc: dave dot korn at artimi dot com (Dave Korn), jlh at gmx dot ch ('jlh'), trt at cs dot duke dot edu ('Thomas R. Truscott'), gcc at gcc dot gnu dot org
- Date: Fri, 10 Dec 2004 11:54:54 -0500 (EST)
- Subject: Re: Unomitted frame pointers
> 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" */