News for hackers. Stuff that matters.
Re:Int a = 5; a = a++ + ++a; a =? (2011) by amelius on Thursday May 14, 2026 @05:01PM (#48141203)
It doesn't matter if the answer is wrong. You run the test program and then replace the code by the answer. This basically weeds out the UB.
Re:Int a = 5; a = a++ + ++a; a =? (2011) by yongjik on Thursday May 14, 2026 @05:22PM (#48141435)
But since it is a UB, there's no guarantee that your test program produces the same result as the same code running on production, even if you have the same compiler.
Re:Int a = 5; a = a++ + ++a; a =? (2011) by amelius on Thursday May 14, 2026 @05:51PM (#48141749)
That's very unlikely, and in the worst case you've reduced a difficult bug into an easier to understand bug.
Re:Int a = 5; a = a++ + ++a; a =? (2011) by 1718627440 on Friday May 15, 2026 @08:35AM (#48147837)
That's a valid approach, if you only use high-level language to generate assembly faster, and the assembly is your source of truth.