Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleGenerated Content

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

Version number:
5.0 

Checker

Guideline

PRE01-CPP. Use parentheses within macros around parameter names
PRE02-CPP. Macro replacement lists should be parenthesized
PRE03-CPP. Prefer typedefs to defines for encoding types
PRE04-CPP. Do not reuse a standard header file name
PRE06-CPP. Enclose header files in an inclusion guard
PRE07-CPP. Avoid using repeated question marks
PRE31-CPP. Avoid side-effects in arguments to unsafe macros
DCL01-CPP. Do not reuse variable names in subscopes
DCL04-CPP. Do not declare more than one variable per declaration
DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
EXP00-CPP. Use parentheses for precedence of operation
EXP06-CPP. Operands to the sizeof operator should not contain side effects
EXP19-CPP. Do not perform assignments in conditional expressions
EXP35-CPP. Do not cast away a const qualification
EXP36-CPP. Do not convert pointers into more strictly aligned pointer types
INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
INT09-CPP. Ensure enumeration constants map to unique values
INT13-CPP. Use bitwise operators only on unsigned operands
ARR01-CPP. Do not apply the sizeof operator to a pointer when taking the size of an array
ARR30-CPP. Guarantee that array and vector indices are within the valid range
STR34-CPP. Cast characters to unsigned types before converting to larger integer sizes
MEM02-CPP. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
MSC04-CPP. Use comments consistently and in a readable fashion
MSC12-CPP. Detect and remove code that has no effect
MSC30-CPP. Do not use the rand() function for generating pseudorandom numbers
1 Q

C++ checkers

Rule

134 S EXP30-CPP. Do not depend on order of evaluation between sequence points
1 Q 134 SEXP30-CPP. Do not depend on order of evaluation between sequence points
248 SINT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errors
344 SEXP32-CPP. Do not access a volatile object through a non-volatile reference
35 DEXP30-CPP. Do not depend on order of evaluation between sequence points
39 SFLP30-CPP. Do not use floating point variables as loop counters
42 DDCL30-CPP. Declare objects with appropriate storage durations
433 S 43 DINT31INT32-CPP. Ensure that integer conversions operations on signed integers do not result in lost or misinterpreted data

434 S

overflow
43 DINT33INT31-CPP. Ensure that integer conversions division and modulo operations do not result in lost or misinterpreted datadivide-by-zero errors
433 SINT31

43 D

INT32-CPP. Ensure that operations on signed integers integer conversions do not result in overflowlost or misinterpreted data
434 SINT31

43 D

INT33-CPP. Ensure that division and modulo operations integer conversions do not result in divide-by-zero errorslost or misinterpreted data
493 SINT32-CPP. Ensure that operations on signed integers do not result in overflow
494 SINT32-CPP. Ensure that operations on signed integers do not result in overflow
573 SPRE30-CPP. Do not create a universal character name through concatenation
575 SDCL36-CPP. Do not declare an identifier with conflicting linkage classifications
591 SFIO38-CPP. Do not use a copy of a FILE object for input and output
71 SDCL30-CPP. Declare objects with appropriate storage durations
75 DFIO31-CPP. Do not simultaneously open the same file multiple times
82 DFIO44-CPP. Only use values for fsetpos() that are returned from fgetpos()
84 DFIO39-CPP. Do not alternately input and output from a stream without an intervening flush or positioning call
86 DFIO30-CPP. Exclude user input from format strings

93 S

INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data
9 SEXP30-CPP. Do not depend on order of evaluation between sequence points
 93 SARR01INT31-CPP. Do not apply the sizeof operator to a pointer when taking the size of an array

 

ARR30-CPP. Guarantee that array and vector indices are within the valid range

 

DCL01-CPP. Do not reuse variable names in subscopes

 

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

 

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

 

EXP00-CPP. Use parentheses for precedence of operation

 

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

 

EXP19-CPP. Do not perform assignments in conditional expressions

 

EXP35-CPP. Do not cast away a const qualification

 

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

 

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

 

INT09-CPP. Ensure enumeration constants map to unique values

 

INT13-CPP. Use bitwise operators only on unsigned operands

 

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

 

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

 

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

 

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

 

PRE01-CPP. Use parentheses within macros around parameter names

 

PRE02-CPP. Macro replacement lists should be parenthesized

 

PRE03-CPP. Prefer typedefs to defines for encoding types

 

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

 

PRE06-CPP. Enclose header files in an inclusion guard

 

PRE07-CPP. Avoid using repeated question marks

 

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

 

STR34-CPP. Cast characters to unsigned types before converting to larger integer sizes Ensure that integer conversions do not result in lost or misinterpreted data