diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-11-21 18:38:18 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-11-21 18:38:18 +0000 |
commit | 4bd9c84c523256b64f8e8a24b1b1284dfc301ef2 (patch) | |
tree | 2be36654a6995bd5baad37ba4ad84349d2e141f2 /gcc/doc | |
parent | 1af4ebf5985ef2aaac13862654044d84a3cd7ae4 (diff) | |
download | gcc-4bd9c84c523256b64f8e8a24b1b1284dfc301ef2.zip gcc-4bd9c84c523256b64f8e8a24b1b1284dfc301ef2.tar.gz gcc-4bd9c84c523256b64f8e8a24b1b1284dfc301ef2.tar.bz2 |
Improve -Wmaybe-uninitialized documentation
* doc/invoke.texi (-Wmaybe-uninitialized): Rephrase for clarity.
From-SVN: r255022
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e18fa54..47323e5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 |