This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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" */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]