This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Doc fix for -Wuninitialized
- To: rth at cygnus dot com, egcs-patches at gcc dot gnu dot org
- Subject: Doc fix for -Wuninitialized
- From: Geoff Keating <geoffk at ozemail dot com dot au>
- Date: Fri, 20 Aug 1999 17:09:38 +1000
The manual implies that you need -W to get warnings about longjmp()
clobbering variables, but actually it's -Wuninitialized that controls
it, and it _is_ turned on by -Wall.
--
Geoffrey Keating <geoffk@cygnus.com>
===File ~/patches/cygnus/setjmp-doc-fix.patch===============
Changed files:
egcs/gcc/invoke.texi
--- /sloth/disk0/co/egcs-mainline/egcs/gcc/invoke.texi Wed Aug 18 20:36:47 1999
+++ egcs/gcc/invoke.texi Fri Aug 20 17:01:33 1999
@@ -1532,6 +1532,16 @@ another common case:
@noindent
This has no bug because @code{save_y} is used only if it is set.
+@cindex @code{longjmp} warnings
+This option also warns when a nonvolatile automatic variable might be
+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
+even when there is in fact no problem because @code{longjmp} cannot
+in fact be called at the place which would cause a problem.
+
Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
@@ -1564,18 +1574,6 @@ the warning.
Print extra warning messages for these events:
@itemize @bullet
-@cindex @code{longjmp} warnings
-@item
-A nonvolatile automatic variable might be changed by a call to
-@code{longjmp}. These warnings as well are possible only in
-optimizing compilation.
-
-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
-even when there is in fact no problem because @code{longjmp} cannot
-in fact be called at the place which would cause a problem.
-
@item
A function can return either with or without a value. (Falling
off the end of the function body is considered returning without
============================================================