aboutsummaryrefslogtreecommitdiff
path: root/gcc/invoke.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/invoke.texi')
-rw-r--r--gcc/invoke.texi69
1 files changed, 43 insertions, 26 deletions
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 6e02bffb10a..223c3f273dd 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -1316,7 +1316,8 @@ unused variables and parameters, use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@item -Wuninitialized
-An automatic variable is used without first being initialized.
+Warn if an automatic variable is used without first being initialized or
+if a variable may be clobbered by a @code{setjmp} call.
These warnings are possible only in optimizing compilation,
because they require data flow information that is computed only
@@ -1375,6 +1376,17 @@ Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
+@cindex @code{longjmp} warnings
+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 -Wreorder (C++ only)
@cindex reordering, warning
@cindex warning for reordering of member initializers
@@ -1417,18 +1429,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
@@ -1599,8 +1599,7 @@ cases where multiple declaration is valid and changes nothing.
Warn if an @code{extern} declaration is encountered within an function.
@item -Winline
-Warn if a function can not be inlined, and either it was declared as inline,
-or else the @samp{-finline-functions} option was given.
+Warn if a function can not be inlined and it was declared as inline.
@item -Wold-style-cast
Warn if an old-style (C-style) cast is used within a program.
@@ -5235,14 +5234,17 @@ it.
@table @code
@item -fexceptions
-Enable exception handling, and generate extra code needed to propagate
-exceptions. If you do not specify this option, GNU CC enables it by
-default for languages like C++ that normally require exception handling,
-and disabled for languages like C that do not normally require it.
-However, when compiling C code that needs to interoperate properly with
-exception handlers written in C++, you may need to enable this option.
-You may also wish to disable this option is you are compiling older C++
-programs that don't use exception handling.
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies GNU CC will generate frame
+unwind information for all functions, which can produce significant data
+size overhead, although it does not affect execution. If you do not
+specify this option, GNU CC will enable it by default for languages like
+C++ which normally require exception handling, and disable itfor
+languages like C that do not normally require it. However, you may need
+to enable this option when compiling C code that needs to interoperate
+properly with exception handlers written in C++. You may also wish to
+disable this option if you are compiling older C++ programs that don't
+use exception handling.
@item -fpcc-struct-return
Return ``short'' @code{struct} and @code{union} values in memory like
@@ -5284,7 +5286,7 @@ shared between processes running the same program, while private data
exists in one copy per process.
@item -fno-common
-Allocate even uninitialized global variables in the bss section of the
+Allocate even uninitialized global variables in the data section of the
object file, rather than generating them as common blocks. This has the
effect that if the same variable is declared (without @code{extern}) in
two different compilations, you will get an error when you link them.
@@ -5409,8 +5411,7 @@ the offsets of structure members won't agree with system libraries.
@item -fcheck-memory-usage
Generate extra code to check each memory access. GNU CC will generate
code that is suitable for a detector of bad memory accesses such as
-@file{Checker}. If you specify this option, you can not use the
-@code{asm} or @code{__asm__} keywords.
+@file{Checker}.
You must also specify this option when you compile functions you call that
have side effects. If you do not, you may get erroneous messages from
@@ -5425,6 +5426,22 @@ which are provided by the detector. If you cannot find or build
stubs for every function you call, you may have to specify
@samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}.
+If you specify this option, you can not use the @code{asm} or
+@code{__asm__} keywords in functions with memory checking enabled. GNU
+CC cannot understand what the @code{asm} statement may do, and therefore
+cannot generate the appropriate code, so it will reject it. However, if
+you specify the function attribute @code{no_check_memory_usage} (see
+@pxref{Function Attributes}, GNU CC will disable memory checking within a
+function; you may use @code{asm} statements inside such functions. You
+may have an inline expansion of a non-checked function within a checked
+function; in that case GNU CC will not generate checks for the inlined
+function's memory accesses.
+
+If you move your @code{asm} statements to non-checked inline functions
+and they do access memory, you can add calls to the support code in your
+inline function, to indicate any reads, writes, or copies being done.
+These calls would be similar to those done in the stubs described above.
+
@item -fprefix-function-name
Request GNU CC to add a prefix to the symbols generated for function names.
GNU CC adds a prefix to the names of functions defined as well as