How can x-- change x by more than one? Use clang: bool y; int x=10; [..] if (y) x--; Aaaad... optimized to x=x-y, uninit y -> c is weeird
-
-
@RichFelker@ValleyC4t@rgov It's a consequence of the standard. C has lots of landmines. It's fast though... Eventually we should move awayThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@RichFelker@SoosMate@rgov it's also obviously wrong code, and a needlessly-permissive interpretation of the buggy spec. -
@ValleyC4t@RichFelker@SoosMate@rgov It's a design choice, not a bug. If you want a safe language, there are plenty to choose from. -
@ValleyC4t@RichFelker@SoosMate@rgov And these basic compiler optimizations are even more important for higher-level safe languages. -
@ValleyC4t@RichFelker@SoosMate@rgov Preventing use before initialization rules out all kinds of correct code, so it's a design choice. -
@ValleyC4t@RichFelker@SoosMate@rgov And uninitialized memory doesn't behave as many people expect even without compiler optimizations. -
@ValleyC4t@RichFelker@SoosMate@rgov The value can be inconsistent between reads with no compiler optimizations. See MADV_FREE. -
@ValleyC4t@RichFelker@SoosMate@rgov And the compiler can assume bool is 0 or 1 even though in broken C code that may not be true. -
@CopperheadSec@RichFelker@SoosMate@rgov here, we are talking about code the compiler can readily determine to be broken. - 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.