logoalt Hacker News

eru • today at 3:55 AM • 0 replies • view on HN

> a reasonably clever compiler can warn about it (and in fact both gcc and clang do so). If the result of INT_MAX + 1 were defined by the language to be INT_MIN, there would be no basis for such a warning.

Compilers warn about perfectly well defined behaviour all the time. That's why these are warnings, not errors.