Chapter 4. GCC Command Options
-Wmissing-prototypes (C only)
Warn if a global function is defined without a previous prototype declaration. This warning is
issued even if the definition itself provides a prototype. The aim is to detect global functions that
fail to be declared in header files.
-Wmissing-declarations (C only)
Warn if a global function is defined without a previous declaration. Do so even if the definition
itself provides a prototype. Use this option to detect global functions that are not declared in
header files.
-Wmissing-noreturn
Warn about functions which might be candidates for attribute
possible candidates, not absolute ones. Care should be taken to manually verify functions actually
do not ever return before adding the
could be introduced. You will not get a warning for
-Wmissing-format-attribute
If
is enabled, also warn about functions which might be candidates for
-Wformat
tributes. Note these are only possible candidates, not absolute ones. GCC will guess that
attributes might be appropriate for any function that calls a function like
but this might not always be the case, and some functions for which
propriate may not be detected. This option has no effect unless
by
).
-Wall
-Wno-multichar
Do not warn if a multicharacter constant (
user's code, as they have implementation-defined values, and should not be used in portable code.
-Wno-deprecated-declarations
Do not warn about uses of functions, variables, and types marked as deprecated by using the
attribute. (Section 6.25 Declaring Attributes of Functions, Section 6.32 Specifying
deprecated
Attributes of Variables, Section 6.33 Specifying Attributes of Types.)
-Wpacked
Warn if a structure is given the packed attribute, but the packed attribute has no effect on the
layout or size of the structure. Such structures may be mis-aligned for little benefit. For instance,
in this code, the variable
not itself have the packed attribute:
struct foo {
int x;
char a, b, c, d;
} __attribute__((packed));
struct bar {
char z;
struct foo f;
};
-Wpadded
Warn if padding is included in a structure, either to align an element of the structure or to align
the whole structure. Sometimes when this happens it is possible to rearrange the fields of the
structure to reduce the padding and so make the structure smaller.
noreturn
'FOOF'
in
f.x
struct bar
noreturn
attribute, otherwise subtle code generation bugs
in hosted C environments.
main
-Wformat
) is used. Usually they indicate a typo in the
will be misaligned even though
. Note these are only
format
format
or
vprintf
vscanf
attributes are ap-
format
is enabled (possibly
struct bar
43
at-
,
does
Need help?
Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?