On Thursday, 20 February 2014 at 22:52:55 UTC, Meta wrote:
I can't think of any C code that would rely on such behaviour, but I think it'd just be safer all-around to make it an error.

Eg this optimization:

if ((unsigned int)(a - min) < (max - min)) // only one comparison instead of two
    {

    }

And there is many C codes relying on unsigned promotion, since signed overflow in C99 is undefined behaviour. The easiest way to force an operation is then to use one cast.



Reply via email to