GCC 4.2 -fstrict-overflow

Howland Craig D (Craig) howland@LGSInnovations.com
Fri Oct 3 09:35:00 GMT 2008


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



More information about the Newlib mailing list