Re: [PATCH] compat: helper for detecting unsigned overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Heya,

On Thu, Feb 10, 2011 at 10:35, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>        unsigned_add_overflows(a, b)

> Define such a macro, expanding roughly to ((a) < UINT_MAX - (b)).
> Because the expansion uses each argument only once outside of sizeof()
> expressions, it is safe to use with arguments that have side effects.

> +#define unsigned_add_overflows(a, b) \
> + Â Â((b) > maximum_unsigned_value_of_type(a) - (a))

I'm confused, you say you won't use it twice, and then you do use it twice?

-- 
Cheers,

Sverre Rabbelier
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]