Chapter 4. GCC Command Options
union U { int i : 4096; };
Assuming that an
number of bits in an
Empty classes can be placed at incorrect offsets. For example:
•
struct A {};
struct B {
A a;
virtual void f ();
};
struct C : public B, public A {};
G++ will place the
mistakenly believes that the
Names of template functions whose types involve
•
can be mangled incorrectly.
template
void f(typename Q::X) {}
template
void f(typename Q int ::X) {}
Instantiations of these templates may be mangled incorrectly.
-Wctor-dtor-privacy (C++ only)
Warn when a class seems unusable because all the constructors or destructors in that class are
private, and it has neither friends nor public static member functions.
-Wnon-virtual-dtor (C++ only)
Warn when a class appears to be polymorphic, thereby requiring a virtual destructor, yet it de-
clares a non-virtual one. This warning is enabled by
-Wreorder (C++ only)
Warn when the order of member initializers given in the code does not match the order in which
they must be executed. For instance:
struct A {
int i;
int j;
A(): j (0), i (1) { }
};
The compiler will rearrange the member initializers for
the members, emitting a warning to that effect. This warning is enabled by
The following
-W...
-Weffc++ (C++ only)
Warn about violations of the following style guidelines from Scott Meyers' [Effective C++] book:
Item 11: Define a copy constructor and an assignment operator for classes with dynamically
•
allocated memory.
Item 12: Prefer initialization to assignment in constructors.
•
does not have 4096 bits, G++ will make the union too small by the
int
.
int
base class of
A
C
data member of
A
typename Q
template
typename
options are not affected by
at a nonzero offset; it should be placed at offset zero. G++
is already at offset zero.
B
typename
class Q
-Wall
and
i
.
-Wall
or template template parameters
.
to match the declaration order of
j
-Wall
27
.
Need help?
Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?