programmerhumor·Programmer Humorbyt҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ Cosmic Rays?View original on lemmy.tgxn.net72Comments9Reply
fflambonkscious replysh.itjust.worksThat resembles some of my PowerShell waaay too much. If it wasn't for the cosmic ray thing, I thought this was my GitHub...3Reply
cchkno lemmy.ml1Hide 1 replyAny sane compiler will simplify this into function cosmicRayDetector() { while(true) { } } C++ may further 'simplify' this into function cosmicRayDetector() { return } 8Reply
LLuciferMorningWood replylemm.eeIirc the issue was that while(true) would be removed while it should be replaced with ret and this caused a bug where the binary would execute next function But I believe this way of cosmic ray detection would work volatile bool condition = true; while(condition) { } printf("Cosmic ray detected"); 4Reply
9 replies
True
False
cosmic ray detected.
You should add returns ray detected outside of while loop
That resembles some of my PowerShell waaay too much. If it wasn't for the cosmic ray thing, I thought this was my GitHub...
Any sane compiler will simplify this into
C++ may further 'simplify' this into
Iirc the issue was that while(true) would be removed while it should be replaced with ret and this caused a bug where the binary would execute next function
But I believe this way of cosmic ray detection would work
The spacing on the parenthesis 🤢🤢🤢