This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: signed is undefined and has been since 1992 (in GCC)







Steven Bosscher wrote on 28/06/2005 09:55:03:

> On Tuesday 28 June 2005 07:12, Gabriel Dos Reis wrote:
> > For the concrete case at issue, if the hardware I'm writing the C/C++
> > programs for consistently displays modulo arithmetics for signed
> > integer type, Andrew can you tell me why GCC should deny me access
> > to that functionally where it actually can?
>
> Because it disallows compiler transformations?  E.g. suddenly a
> loop with a signed variable as the loop counter may wrap around,
> which that means some transformations that are safe now would
> no longer be safe.

So maybe introduce a -fsigned-wraps flag, that the user can use
to make 'int' wrap even in loops. We have -fstrict-aliasing, so why
not have -fsigned-wraps for users who want it. This way everybody
will be happy (Gaby and Andrew in particular).
I don't care either way, as long as numeric_limits is consistent.

  Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]