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: gcc at gcc dot gnu dot org
- Date: Fri, 10 Dec 2004 10:44:12 -0500 (EST)
- Subject: Re: Unomitted frame pointers
Off-topic, but the hello.c program does:
write(2, "Hello World!\n\0", 16);
The string length is 15, not 16.
It would be nice if gcc issued warnings for compile-time constant
string/length pairs where the length is too large.
I do that in my local copy of gcc, and it routinely finds
coding mistakes for memcpy().
Perhaps this could somehow be an "attribute" that gcc can check.
(Hmm, the attribute thing is too limited, what would be really
nice is a way to write code that does general compile-time argument
checking. Then one could do more thorough checks such as is
done for printf/scanf. And the same code could be invoked
at run time ... oops, way off topic.)
Tom Truscott