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

Compare with Current View Page History

« Previous Version 18 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.1

C++ checkers

Rule

araydecl

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

araydecl

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

bitftype

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

castexpr

EXP05-CPP. Do not use C-style casts

castexpr

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

castexpr

EXP35-CPP. Do not cast away a const qualification

castexpr

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

charcast

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

charplan

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

cplxcall

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

declgrup_srceline

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

declhidn

DCL01-CPP. Do not reuse variable names in subscopes

dtrigraf

PRE07-CPP. Avoid using repeated question marks

enuminit

INT09-CPP. Ensure enumeration constants map to unique values

exprprns

EXP00-CPP. Use parentheses for precedence of operation

exprprns

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

idntsiml

DCL02-CPP. Use visually distinct identifiers

ignrtrn

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

inclgard

PRE06-CPP. Enclose header files in an inclusion guard

ltrlsynt

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

macrbody

PRE01-CPP. Use parentheses within macros around parameter names

macrbody

PRE02-CPP. Macro replacement lists should be parenthesized

macrcall

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

minscope

DCL07-CPP. Minimize the scope of variables and methods

nomagicc

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

stlibuse

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

stlibuse

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

stlibuse

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

stlibuse

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

swchsynt

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

trycatch

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

  • No labels