Red Hat ENTERPRISE LINUX 4 Manual page 43

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 4. GCC Command Options
-Winit-self (C, C++, and Objective-C only)
Warn about uninitialized variables which are initialized with themselves. Note this option can
only be used with the
For example, GCC will warn about
has been specified:
-Winit-self
int f()
{
int i = i;
return i;
}
-Wimplicit-int
Warn when a declaration does not specify a type.
-Wimplicit-function-declaration
-Werror-implicit-function-declaration
Give a warning (or error) whenever a function is used before being declared.
-Wimplicit
Same as
-Wimplicit-int
-Wmain
Warn if the type of
int, taking either zero arguments, two, or three arguments of appropriate types.
-Wmissing-braces
Warn if an aggregate or union initializer is not fully bracketed. In the following example, the
initializer for
a
int a[2][2] = { 0, 1, 2, 3 };
int b[2][2] = { { 0, 1 }, { 2, 3 } };
-Wparentheses
Warn if parentheses are omitted in certain contexts, such as when there is an assignment in a
context where a truth value is expected, or when operators are nested whose precedence people
often get confused about.
Also warn about constructions where there may be confusion to which
branch belongs. Here is an example of such a case:
{
if (a)
if (b)
foo ();
else
bar ();
}
In C, every
else
is
. This is often not what the programmer expected, as illustrated in the above example
if (b)
by indentation the programmer chose. When there is the potential for this confusion, GCC will
issue a warning when this flag is specified. To eliminate the warning, add explicit braces around
the innermost
if
resulting code would look like this:
-Wuninitialized
and
-Wimplicit-function-declaration
is suspicious.
main
is not fully bracketed, but that for
branch belongs to the innermost possible
statement so there is no way the
option, which in turn only works with
being uninitialized in the following snippet only when
i
should be a function with external linkage, returning
main
is fully bracketed.
b
could belong to the enclosing
else
.
statement an
if
statement, which in this example
if
35
and above.
-O1
else
. The
if

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents