Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • 2
    With any optimization level above -O0, gcc 4.7 optimizes out everything except the calls to printf. I checked the assembly code and it's just two calls to printf. So gcc's compile-time evaluation is not detecting the uninitialized value. And valgrind has no chance to detect it at runtime since it's only two calls to printf with constant arguments. Commented Oct 7, 2014 at 22:06