t҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ ( @tgxn@lemmy.tgxn.net ) Programmer Humor@lemmy.mlEnglish • 1 year ago
You must log in or register to comment.
- Xanvial ( @Xanvial@beehaw.org ) English4•1 year ago
You should add returns ray detected outside of while loop
- flambonkscious ( @flambonkscious@sh.itjust.works ) English3•1 year ago
That resembles some of my PowerShell waaay too much. If it wasn’t for the cosmic ray thing, I thought this was my GitHub…
- chkno ( @chkno@lemmy.ml ) English4•1 year ago
Any sane compiler will simplify this into
function cosmicRayDetector() { while(true) { } }
C++ may further ‘simplify’ this into
function cosmicRayDetector() { return }
- LuciferMorningWood ( @LuciferMorningWood@lemm.ee ) English2•1 year ago
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
volatile bool condition = true; while(condition) { } printf("Cosmic ray detected");
- Attempted_Render ( @Attempted_Render@lemmy.fmhy.ml ) English2•1 year ago
True
- tj111 ( @tj111@lemmy.fmhy.ml ) English2•1 year ago
False
- Attempted_Render ( @Attempted_Render@lemmy.fmhy.ml ) English4•1 year ago
cosmic ray detected.