@chkno@lemmy.ml
link
fedilink
English
1
edit-2
1Y

Any sane compiler will simplify this into

    function cosmicRayDetector() {
      while(true) {
      }
    }

C++ may further ‘simplify’ this into

    function cosmicRayDetector() {
      return
    }

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");
@Xanvial@beehaw.org
link
fedilink
English
11Y

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…

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog