Improve -Wmaybe-uninitialized documentation

* doc/invoke.texi (-Wmaybe-uninitialized): Rephrase for clarity.

From-SVN: r255022
This commit is contained in:
Jonathan Wakely 2017-11-21 18:38:18 +00:00 committed by Jonathan Wakely
parent 1af4ebf598
commit 4bd9c84c52
2 changed files with 15 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2017-11-21 Jonathan Wakely <jwakely@redhat.com>
* doc/invoke.texi (-Wmaybe-uninitialized): Rephrase for clarity.
2017-11-21 Marc Glisse <marc.glisse@inria.fr>
* doc/generic.texi: Document POINTER_DIFF_EXPR, update

View file

@ -4974,14 +4974,18 @@ void store (int *i)
@item -Wmaybe-uninitialized
@opindex Wmaybe-uninitialized
@opindex Wno-maybe-uninitialized
For an automatic variable, if there exists a path from the function
entry to a use of the variable that is initialized, but there exist
For an automatic (i.e.@ local) variable, if there exists a path from the
function entry to a use of the variable that is initialized, but there exist
some other paths for which the variable is not initialized, the compiler
emits a warning if it cannot prove the uninitialized paths are not
executed at run time. These warnings are made optional because GCC is
not smart enough to see all the reasons why the code might be correct
in spite of appearing to have an error. Here is one example of how
this can happen:
executed at run time.
These warnings are only possible in optimizing compilation, because otherwise
GCC does not keep track of the state of variables.
These warnings are made optional because GCC may not be able to determine when
the code is correct in spite of appearing to have an error. Here is one
example of how this can happen:
@smallexample
@group
@ -5008,9 +5012,7 @@ similar code.
@cindex @code{longjmp} warnings
This option also warns when a non-volatile automatic variable might be
changed by a call to @code{longjmp}. These warnings as well are possible
only in optimizing compilation.
changed by a call to @code{longjmp}.
The compiler sees only the calls to @code{setjmp}. It cannot know
where @code{longjmp} will be called; in fact, a signal handler could
call it at any point in the code. As a result, you may get a warning