Announcement

Collapse
No announcement yet.

Proposed GCC 12 Security Option Would Auto Initialize Automatic Variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #61
    > know their compiler even offers such options.

    heh. Yeah, I'll concede that part for the majority of cases.

    I'm still not in favor of this feature at all *as specified* though. As a "valgrind Iite" that segfaults when it finds one, sure, but not more than that.
    I get your point, but even from an end user perspective this is Russian Roulette and needs to be kept out of production code. Maybe that uninitialised var being TRUE 99.6% of the time is what makes the code take the RIGHT path...

    Comment


    • #62
      Originally posted by arQon View Post
      I get your point, but even from an end user perspective this is Russian Roulette and needs to be kept out of production code. Maybe that uninitialised var being TRUE 99.6% of the time is what makes the code take the RIGHT path...
      Of course it's not going to be the right value, in all cases, but 0 is certainly the single initializer value most likely to be correct.

      But I also made an important point about determinism, which is that whether something works properly or malfunctions, it's desirable to have it behave consistently. If it succeeds once, you want it always to succeed. If it fails once, then having it always fail at least makes it easier to debug.

      Comment


      • #63
        Originally posted by coder View Post
        But I also made an important point about determinism ... If it fails once, then having it always fail at least makes it easier to debug.
        I missed that in my rushed catch-up, sorry. That's an excellent point.

        Comment

        Working...
        X