Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions page 29

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

Chapter 4. GCC Command Options
struct C : public A, public virtual B {};
In this case, G++ will not place
avoid this problem by explicitly padding
ing virtual base classes); that will cause G++ and other compilers to layout
Incorrect handling of bit-fields with declared widths greater than that of their underlying types,
when the bit-fields appear in a union. For example:
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 a class are
private and the class has no friends or public static member functions.
-Wnon-virtual-dtor (C++ only)
Warn when a class declares a non-virtual destructor that should probably be virtual, because it
looks like the class will be used polymorphically. 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) { }
};
Here the compiler will warn that the member initializers for
the declaration order of the members. This warning is enabled by
The following
-W...
B
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
into the tail-padding for
so that its size is a multiple of its alignment (ignor-
A
at a nonzero offset; it should be placed at offset zero. G++
is already at offset zero.
B
typename
class Q
.
-Wall
; other compilers will. You can
A
identically.
C
or template template parameters
-Wall
and
will be rearranged to match
i
j
.
-Wall
23
.

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Enterprise linux 3

Table of Contents