------- Comment #50 from pinskia at gcc dot gnu dot org  2007-01-22 22:27 
-------
There is no nothing special about signed integer overflow in C, it is just
undefined behavior at runtime.  I had forgot to mention the SPEC results
because I don't feel SPEC CPU or any benchmark is a good way to measure your
own code.  And with -fwrapv being default, you punish people who write valid
and well defined C programs which causes those people to get up set and we
already get more of those complaints than getting complaints about signed
integer being undefined in C.  If you really want to make a difference, raise
an issue with the C standards committee (just a word of cation, they might
laugh at you and tell you to go away) with a very very good reason to make
signed integer overflow as implementation defined; plain out security checks is
not a good reason as you can check for the issues before they can happen as
already mentioned.

I would agree with your idea of turning on -fwrapv if there was no way to check
for overflow before they happened but there are ways.  Yes we are going to
break  code which was written using the assumtion that signed integer overflow
is defined as wrapping but that is a cost which we can take, I think.  


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475

Reply via email to