On 11/15/2017 07:31 AM, Jonathan Wakely wrote:
The docs for -Wmaybe-uninitialized have some issues:

- That first sentence is looooooong.
- Apparently some C++ programmers think "automatic variable" means one
 declared with C++11 `auto`, rather than simply a local variable.
- The sentence about only warning when optimizing is stuck in between
 two chunks talking about longjmp, which could be inferred to mean
 only the setjmp/longjmp part of the warning depends on optimization.

This attempts to make it easier to parse and understand.

I've always found the description remarkably precise.  Particularly
the bit where it talks about the two paths, one initialized and the
other not.  Your rewording loses that distinction so I don't think
it's as accurate, or even correct.

To use an example, this would satisfy the new description:

  int f (void)
  {
    int i;
    return i;
  }

but it doesn't match GCC behavior (it triggers -Wuninitialized,
not -Wmaybe-uninitialized).  Unless the distinction is more
subtle than I ascribe to it I think it needs to be preserved
in the rewording.

Martin

Reply via email to