[Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 17 19:08:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
--- Comment #26 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to baoshan from comment #25)
> > Why wrapping is well defined for unsigned types so adding 4294967295 is the
> > same as subtracting by 1.
>
> What is wrapping? and where it is defined? I don't know this part and I like
> to learn it.
> Thanks.
Just read the C or C++ standards?
E.g. C99, 6.2.5/9:
... "A computation involving unsigned operands can never overflow,
because a result that cannot be represented by the resulting unsigned integer
type is reduced modulo the number that is one greater than the largest value
that can be represented by the resulting type." ...
More information about the Gcc-bugs
mailing list