You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

Generated Content

This page is automatically generated from the "Automated Detection" sections in the individual guidelines. Do not modify this page directly.

Version number:
1.2

C++ checkers

Rule

CC2.DCL36

DCL36-CPP. Do not declare an identifier with conflicting linkage classifications

CC2.EXP30

EXP30-CPP. Do not depend on order of evaluation between sequence points

CC2.FLP30

FLP30-CPP. Do not use floating point variables as loop counters

CP1.ARR02

ARR02-CPP. Explicitly specify array bounds, even if implicitly defined by an initializer

CP1.DCL00

DCL00-CPP. Const-qualify immutable objects

CP1.DCL01

DCL01-CPP. Do not reuse variable names in subscopes

CP1.DCL02

DCL02-CPP. Use visually distinct identifiers

CP1.DCL03

DCL03-CPP. Use a static assertion to test the value of a constant expression

CP1.DCL04

DCL04-CPP. Do not declare more than one variable per declaration

CP1.DCL06

DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic

CP1.DCL07

DCL07-CPP. Minimize the scope of variables and methods

CP1.DCL13

DCL13-CPP. Declare function parameters that are pointers to values not changed by the function as const

CP1.DCL15

DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace

CP1.DCL16

DCL16-CPP. Use "L," not "l," to indicate a long value

CP1.ERR01

ERR01-CPP. Use ferror() rather than errno to check for FILE stream errors

CP1.ERR36

ERR36-CPP. Multiple catch handlers to a try block should order their exceptions from most derived to most basic

CP1.EXP00

EXP00-CPP. Use parentheses for precedence of operation

CP1.EXP05

EXP05-CPP. Do not use C-style casts

CP1.EXP06

EXP06-CPP. Operands to the sizeof operator should not contain side effects

CP1.EXP09

EXP09-CPP. Use sizeof to determine the size of a type or variable

CP1.EXP12

EXP12-CPP. Do not ignore values returned by functions or methods

CP1.EXP14

EXP14-CPP. Do not use reinterpret_cast on pointers to class objects with multiple inheritence

CP1.EXP15

EXP15-CPP. Beware of integer promotion when performing bitwise operations on chars or shorts

CP1.EXP17

EXP17-CPP. Treat relational and equality operators as if they were nonassociative

CP1.EXP19

EXP19-CPP. Do not perform assignments in conditional expressions

CP1.EXP31

EXP31-CPP. Avoid side effects in assertions

CP1.EXP35

EXP35-CPP. Do not cast away a const qualification

CP1.EXP36

EXP36-CPP. Do not convert pointers into more strictly aligned pointer types

CP1.EXP37

EXP37-CPP. Call variadic functions with the arguments intended by the API

CP1.FIO07

FIO07-CPP. Prefer fseek() to rewind()

CP1.FIO12

FIO12-CPP. Prefer setvbuf() to setbuf()

CP1.FLP31

FLP31-CPP. Do not call functions expecting real values with complex values

CP1.FLP35

FLP35-CPP. Take granularity into account when comparing floating point values

CP1.INT02

INT02-CPP. Understand integer conversion rules

CP1.INT04

INT34-CPP. Do not shift a negative number of bits or more bits than exist in the operand

CP1.INT07

INT07-CPP. Use only explicitly signed or unsigned char type for numeric values

CP1.INT09

INT09-CPP. Ensure enumeration constants map to unique values

CP1.INT12

INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression

CP1.INT13

INT13-CPP. Use bitwise operators only on unsigned operands

CP1.MEM02

MEM02-CPP. Immediately cast the result of a memory allocation function call into a pointer to the allocated type

CP1.MSC04

MSC04-CPP. Use comments consistently and in a readable fashion

CP1.MSC05

MSC05-CPP. Do not manipulate time_t typed values directly

CP1.MSC12

MSC12-CPP. Detect and remove code that has no effect

CP1.MSC18

MSC18-CPP. Finish every set of statements associated with a case label with a break statement

CP1.MSC20

MSC20-CPP. Do not use a switch statement to transfer control into a complex block

CP1.MSC22

MSC22-CPP. Do not define static private members

CP1.MSC30

MSC30-CPP. Do not use the rand() function for generating pseudorandom numbers

CP1.PRE00

PRE00-CPP. Avoid defining macros

CP1.PRE01

PRE01-CPP. Use parentheses within macros around parameter names

CP1.PRE02

PRE02-CPP. Macro replacement lists should be parenthesized

CP1.PRE03

PRE03-CPP. Prefer typedefs to defines for encoding types

CP1.PRE04

PRE04-CPP. Do not reuse a standard header file name

CP1.PRE06

PRE06-CPP. Enclose header files in an inclusion guard

CP1.PRE07

PRE07-CPP. Avoid using repeated question marks

CP1.PRE08

PRE08-CPP. Guarantee that header file names are unique

CP1.PRE12

PRE12-CPP. Do not define unsafe macros

CP1.PRE31

PRE31-CPP. Avoid side-effects in arguments to unsafe macros

CP1.STR04

STR04-CPP. Use plain char for characters in the basic character set

CP1.STR34

STR34-CPP. Cast characters to unsigned types before converting to larger integer sizes

CP1.STR36

STR36-CPP. Do not specify the bound of a character array initialized with a string literal

CP1.STR37

STR37-CPP. Arguments to character handling functions must be representable as an unsigned char

  • No labels