Red Hat ENTERPRISE LINUX 4 Manual page 36

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

Advertisement

28
Item 14: Make destructors virtual in base classes.
Item 15: Have
Item 23: Don't try to return a reference when you must return an object.
Also warn about violations of the following style guidelines from Scott Meyers' [More Effective
C++] book:
Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
Item 7: Never overload
When selecting this option, be aware that the standard library headers do not obey all of these
guidelines; use
grep -v
-Wno-deprecated (C++ only)
Do not warn about usage of deprecated features. Section 7.12 Deprecated Features.
-Wno-non-template-friend (C++ only)
Disable warnings when non-templatized friend functions are declared within a template. Since
the advent of explicit template specification support in G++, if the name of the friend is an
unqualified-id (i.e.,
declare or define an ordinary, nontemplate function. (Section 14.5.3). Before G++ implemented
explicit specification, unqualified-ids could be interpreted as a particular specialization of a
templatized function. Because this non-conforming behavior is no longer the default behav-
ior for G++,
-Wnon-template-friend
tential trouble spots and is on by default. This new compiler behavior can be turned off with
-Wno-non-template-friend
helpful warning.
-Wold-style-cast (C++ only)
Warn if an old-style (C-style) cast to a non-void type is used within a C++ program. The new-
style casts (
static_cast
intended effects and much easier to search for.
-Woverloaded-virtual (C++ only)
Warn when a function declaration hides virtual functions from a base class. For example, in:
struct A {
virtual void f();
};
struct B: public A {
void f(int);
};
the
class version of
A
B* b;
b- f();
will fail to compile.
-Wno-pmf-conversions (C++ only)
Disable the diagnostic for converting a bound pointer to member function to a plain pointer.
return a reference to
operator=
,
, or
&&
||
,
to filter out those warnings.
friend foo(int)
which keeps the conformant compiler code but disables the
,
reinterpret_cast
is hidden in
, and code like:
f
B
Chapter 4. GCC Command Options
.
*this
.
), the C++ language specification demands that the friend
allows the compiler to check existing code for po-
, and
const_cast
) are less vulnerable to un-

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?

Table of Contents