Fellas, why is this happening, especially sometimes but not other times?

Here, I run the program three times, getting the exact same correct output. On the fourth, it outputs broken numbers. The function prnStats what’s being executed.

  • @lofenyyOP
    link
    11 year ago

    I tried -fsanitize=undefined and -fsanitize=unreachable with no luck. Are there other appropriate sanitizers I’m missing?

    • @[email protected]
      link
      fedilink
      2
      edit-2
      1 year ago

      The uninitialized variables would have required -fsanitize=memory but that one can be hard to use because IIUC it requires recompiling all dependencies.

      However in this case you likely would have got a compiler warning. I recommend compiling with -Wall to start, you can then turn off a few warnings that are too noisy.

      • @lofenyyOP
        link
        11 year ago

        Thanks for the help! I’ll definitely start using -Wall. I don’t know why I don’t do it by default…