News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about undefined behavior by wyldfire on Monday November 28, 2022 @07:44AM (#33772910)
"The line with UB" becomes a very vague notion well before the program even executes. You can see this by dumping the disassembly of your program. The compiler can determine when values are defined and used and will emit code that satisfies the semantics of your program (according to the language specification). This often means that expressions within the same statement get evaluated at significantly different times, hoisted outside of loops, etc.
Re:Falsehoods programmers believe about undefined behavior by caf on Monday November 28, 2022 @09:10AM (#33773807)
The assembly dump does not matter for this analysis (except for finding buggy compilers!) - the C abstract machine itself applies all side-effects before each sequence point.