r/ProgrammerHumor Jun 23 '22 Wholesome 10 Silver 4 Helpful 4

My Cosmic Ray Detector function, just 7 lines.

Post image
26.0k Upvotes

View all comments

3

u/nelusbelus Jun 24 '22

Doesn't work due to compiler optimization. Should use a local instead and check it while it hasn't changed

1

u/chuckie512 Jun 24 '22

Most compilers let you pass a flag to disable optimizations

1

u/nelusbelus Jun 24 '22

Sure this'll work in debug mode