[PATCH] [Sema] Don't warn if taking the absolute value of a difference of unsigned values.

Joerg Sonnenberger joerg at britannica.bec.de
Fri Jun 5 04:10:09 PDT 2015


On Fri, Jun 05, 2015 at 05:52:25AM +0000, Richard Smith wrote:
> The difference of two unsigned promoted types is also unsigned, so
> cannot be negative. Perhaps we should word the warning differently in
> this case, but a warning does seem justified.

More importantly, abs(a-b) != a-b if the difference is large enough.

Joerg



More information about the cfe-commits mailing list