This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada front-end depends on signed overflow
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: schlie at comcast dot net (Paul Schlie)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), fw at deneb dot enyo dot de (Florian Weimer), gcc at gcc dot gnu dot org (GCC List), bosch at gnat dot com
- Date: Fri, 3 Jun 2005 11:43:32 -0400 (EDT)
- Subject: Re: Ada front-end depends on signed overflow
>
> > No they should be using -ftrapv instead which traps on overflow and then
> > make sure they are not trapping when testing.
>
> - why? what language or who's code/target ever expects such a behavior?
Everyone's who writes C/C++ should know that overflow of signed is undefined.
Now in Java it is defined, which is the reason why -fwrapv exists in the
place since GCC has a "Java" compiler.
I think you need to go back in the archives and read the disscusions about
when -fwrapv was added and see why it is not turned on by default for C.
http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00850.html
http://gcc.gnu.org/ml/gcc-patches/2003-03/msg02126.html
http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01727.html
And a couple more places.
Thanks,
Andrew Pinski