Checker | Guideline |
---|
CC2.EXP30 | EXP50-CPP. Do not depend on the order of evaluation for side effects |
CC2.MSC30 | MSC50-CPP. Do not use std::rand() for generating pseudorandom numbers |
CP1.ARR02 | CTR02-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 | ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived |
CP1.EXP00 | EXP00-CPP. Use parentheses for precedence of operation |
CP1.EXP05 | EXP05-CPP. Do not use C-style casts |
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.FIO07 | FIO07-CPP. Prefer fseek() to rewind() |
CP1.FIO12 | FIO12-CPP. Prefer setvbuf() to setbuf() |
CP1.INT02 | INT02-CPP. Understand integer conversion rules |
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 | MSC19-CPP. Do not define static private members |
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 | PRE10-CPP. Do not define unsafe macros |
CP1.STR04 | STR04-CPP. Use plain char for characters in the basic character set |
CP1.STR36 | STR08-CPP. Do not specify the bound of a character array initialized with a string literal |