Filter
Exclude
Time range
-
Near
About GCC optimizing away signed overflow checks #GCC #IntegerOverflow #SecureCompiling

There's an extremely funny thread on GCC Bugzilla about GCC optimizing away signed overflow checks. The OP is bitching relentlessly about how unprofessional and stupid GCC developers responsible for this behavior are, but the best part is the OP getting repeatedly recommended an approach for preventing signed overflows, here are two examples: - "The original poster might want to read <link1> and <link2> to see how he might "prevent people from getting hacked" correctly." - "<link2> is all I am going to say from now on. It tell you explictly how to dectect an overflow before an overflow is going to happen." The latter is written by a GCC developer. The catch? The approach doesn't work. Not only that, its description explicitly states that it "may fail if invoked on various edge cases, such as the smallest negative integer, INT_MIN", see the screenshot. Let that sink in: a GCC developer is recommending a function that can cause signed overflow (and therefore "undefined behavior") to help preventing signed overflow (and therefore "undefined behavior"). It's just so hilarious that a GCC developer isn't capable of comprehending two short sentences on a topic directly related to their literal job. YET AGAIN, because they failed to understand the C standard too when interpreting what "undefined behavior" means. I'll include some of the best bitching below and provide a link.
1
8
986