Developer Guide and Reference

Contents

Weffc++, Qeffc++

Enables warnings based on certain C++ programming guidelines.

Syntax

Linux:
-Weffc++
macOS:
-Weffc++
Windows:
/Qeffc++
Arguments
None
Default
OFF
Diagnostics are not enabled.
Description
This option enables warnings based on certain programming guidelines developed by Scott Meyers in his books on effective C++ programming. With this option, the compiler emits warnings for these guidelines:
  • Use
    const
    and
    inline
    rather than
    #define
    . Note that you will only get this in user code, not system header code.
  • Use
    <iostream>
    rather than
    <stdio.h>
    .
  • Use
    new
    and
    delete
    rather than
    malloc
    and
    free
    .
  • Use C++ style comments in preference to C style comments. C comments in system headers are not diagnosed.
  • Use
    delete
    on pointer members in destructors. The compiler diagnoses any pointer that does not have a
    delete
    .
  • Make sure you have a user copy constructor and assignment operator in classes containing pointers.
  • Use initialization rather than assignment to members in constructors.
  • Make sure the initialization list ordering matches the declartion list ordering in constructors.
  • Make sure base classes have virtual destructors.
  • Make sure
    operator=
    returns
    *this
    .
  • Make sure prefix forms of increment and decrement return a
    const
    object.
  • Never overload operators
    &&
    ,
    ||
    , and
    ,
    .
The warnings generated by this compiler option are based on the following books from Scott Meyers:
  • Effective C++ Second Edition - 50 Specific Ways to Improve Your Programs and Designs
  • More Effective C++ - 35 New Ways to Improve Your Programs and Designs
Alternate Options
None

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804