Cosmic Rays?lemmy.tgxn.netimage t҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ ( @tgxn@lemmy.tgxn.net ) Programmer Humor@lemmy.mlEnglish • 1 year ago message-square7fedilinkarrow-up129
arrow-up129imageCosmic Rays?lemmy.tgxn.net t҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ ( @tgxn@lemmy.tgxn.net ) Programmer Humor@lemmy.mlEnglish • 1 year ago message-square7fedilink
minus-square chkno ( @chkno@lemmy.ml ) linkfedilinkEnglish4•edit-21 year agoAny sane compiler will simplify this into function cosmicRayDetector() { while(true) { } } C++ may further ‘simplify’ this into function cosmicRayDetector() { return }
minus-square LuciferMorningWood ( @LuciferMorningWood@lemm.ee ) linkfedilinkEnglish2•1 year agoIirc 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");
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