Commit 4bd9c84c by Jonathan Wakely Committed by Jonathan Wakely

Improve -Wmaybe-uninitialized documentation

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

From-SVN: r255022
parent 1af4ebf5
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> 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
* doc/generic.texi: Document POINTER_DIFF_EXPR, update * doc/generic.texi: Document POINTER_DIFF_EXPR, update
...@@ -4974,14 +4974,18 @@ void store (int *i) ...@@ -4974,14 +4974,18 @@ void store (int *i)
@item -Wmaybe-uninitialized @item -Wmaybe-uninitialized
@opindex Wmaybe-uninitialized @opindex Wmaybe-uninitialized
@opindex Wno-maybe-uninitialized @opindex Wno-maybe-uninitialized
For an automatic variable, if there exists a path from the function For an automatic (i.e.@ local) variable, if there exists a path from the
entry to a use of the variable that is initialized, but there exist 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 some other paths for which the variable is not initialized, the compiler
emits a warning if it cannot prove the uninitialized paths are not emits a warning if it cannot prove the uninitialized paths are not
executed at run time. These warnings are made optional because GCC is executed at run time.
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 These warnings are only possible in optimizing compilation, because otherwise
this can happen: 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 @smallexample
@group @group
...@@ -5008,9 +5012,7 @@ similar code. ...@@ -5008,9 +5012,7 @@ similar code.
@cindex @code{longjmp} warnings @cindex @code{longjmp} warnings
This option also warns when a non-volatile automatic variable might be 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 changed by a call to @code{longjmp}.
only in optimizing compilation.
The compiler sees only the calls to @code{setjmp}. It cannot know The compiler sees only the calls to @code{setjmp}. It cannot know
where @code{longjmp} will be called; in fact, a signal handler could 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 call it at any point in the code. As a result, you may get a warning
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment