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:
v5.0 

 

Checker

Guideline

C++ checkers

Rule

 

EXP54-CPP. Do not access an object outside of its lifetime

EXP50-CPP. Do not depend on the order of evaluation for side effects

 

VOID FIO30-CPP. Exclude user input from format strings

MEM50-CPP. Do not access freed memory
MEM52-CPP. Detect and handle memory allocation errors
MSC50-CPP. Do not use std::rand() for generating pseudorandom numbers
CTR01

 

FIO50-CPP. Do not alternately input and output from a file stream without an intervening positioning call

 

MEM50-CPP. Do not access freed memory

 

MEM52-CPP. Detect and handle memory allocation errors

apply the sizeof operator to a pointer when taking the size of an array
CTR02-CPP. Explicitly specify array bounds, even if implicitly defined by an initializer
DCL01-CPP. Do not reuse variable names in subscopes
DCL02-CPP. Use visually distinct identifiers
DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
DCL13-CPP. Declare function parameters that are pointers to values not changed by the function as const
EXP09-CPP. Use sizeof to determine the size of a type or variable
EXP12-CPP. Do not ignore values returned by functions or methods
EXP15-CPP. Beware of integer promotion when performing bitwise operations on chars or shorts
EXP19-CPP. Do not perform assignments in conditional expressions
FIO07-CPP. Prefer fseek() to rewind()
FIO12-CPP. Prefer setvbuf() to setbuf()
INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
INT09-CPP. Ensure enumeration constants map to unique values
INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
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
MSC05-CPP. Do not manipulate time_t typed values directly
MSC18-CPP. Finish every set of statements associated with a case label with a break statement
STR04-CPP. Use plain char for characters in the basic character set
STR08-CPP. Do not specify the bound of a character array initialized with a string literal

 

:rand() for generating pseudorandom numbers

>