38
-Wunreachable-code
Warn if the compiler detects that code will never be executed.
This option is intended to warn when the compiler detects that at least a whole line of source
code will never be executed, because some condition is never satisfied or because it is after a
procedure that never returns.
It is possible for this option to produce a warning even though there are circumstances un-
der which part of the affected line can be executed, so care should be taken when removing
apparently-unreachable code.
For instance, when a function is inlined, a warning may mean that the line is unreachable in only
one inlined copy of the function.
This option is not made part of
substantial code which checks correct functioning of the program and is, hopefully, unreachable
because the program does work. Another common use of unreachable code is to provide behavior
which is selectable at compile-time.
-Winline
Warn if a function can not be inlined and it was declared as inline.
-Wno-invalid-offsetof (C++ only)
Suppress warnings from applying the
1998 ISO C++ standard, applying
implementations, however,
certain kinds of non-POD types. (Such as a simple
by virtue of having a constructor.) This flag is for users who are aware that they are writing
nonportable code and who have deliberately chosen to ignore the warning about it.
The restrictions on
-Winvalid-pch
Warn if a precompiled header (refer to Section 4.20 Using Precompiled Headers) is found in the
search path but cannot be used.
-Wlong-long
Warn if
long long
-Wno-long-long
when
-pedantic
-Wdisabled-optimization
Warn if a requested optimization pass is disabled. This warning does not generally indicate that
there is anything wrong with your code; it merely indicates that GCC's optimizers were unable
to handle the code effectively. Often, the problem is that your code is too big or too complex;
GCC will refuse to optimize programs when the optimization itself is likely to take inordinate
amounts of time.
-Werror
Make all warnings into errors.
4.9. Options for Debugging Your Program or GCC
GCC has various special options that are used for debugging either your program or GCC:
because in a debugging version of a program there is often
-Wall
offsetof
offsetof
typically gives meaningful results even when applied to
offsetof
may be relaxed in a future version of the C++ standard.
offsetof
type is used. This is default. To inhibit the warning messages, use
. Flags
-Wlong-long
flag is used.
Chapter 4. GCC Command Options
macro to a non-POD type. According to the
to a non-POD type is undefined. In existing C++
that fails to be a POD type only
struct
and
-Wno-long-long
are taken into account only
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?
Questions and answers