Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
amelius
4 months ago
|
parent
|
context
|
favorite
| on:
Int a = 5; a = a++ + ++a; a =? (2011)
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.
yongjik
4 months ago
|
next
[–]
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.
amelius
4 months ago
|
parent
|
next
[–]
That's very unlikely, and in the worst case you've reduced a difficult bug into an easier to understand bug.
1718627440
4 months ago
|
prev
[–]
That's a valid approach, if you only use high-level language to generate assembly faster, and the assembly is your source of truth.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: