This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
GCC 4.2 -fstrict-overflow
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: <newlib at sources dot redhat dot com>
- Date: Thu, 2 Oct 2008 14:39:54 -0400
- Subject: GCC 4.2 -fstrict-overflow
The recent thread concerning the behavior of the optimized strstr()
function indirectly raises the question of behavior with signed
overflow.
Starting with GCC 4.2, they added the -fstrict-overflow option, which is
on by default with -O2. (See http://gcc.gnu.org/gcc-4.2/changes.html)
(The strstr line in question is unsigned by virtue of being size_t, and
so could not be affected.) Along with this, the -Wstrict-overflow
option
has been added (and is part of -Wall) to emit a warning when these
constructs are found. I don't yet have access to 4.2 or 4.3. Has
anyone
done a Newlib build with GCC 4.2 or later and looked for warnings
related
to this?
Craig Howland