Versions Compared

Key

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

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

Version number:
v5.0 

and should not be edited.

Note

The information on this page was provided by outside contributors and has not been verified by SEI CERT.

Tip

The table below can be re-ordered, by clicking column headers.

...

Include Page
Rose_V
Rose_V

Checker

Guideline

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
Can detect simple violations of this rule. It needs to examine each expression and make sure that no variable is modified twice in the expression. It also must check that no variable is modified once, then read elsewhere, with the single exception that a variable may appear on both the left and right of an assignment operator EXP50-CPP. Do not depend on the order of evaluation for side effects

Checker

Guideline

DCL01-CPP. Do not reuse variable names in subscopesDCL02-CPP. Use visually distinct identifiersDCL06-CPP. Use meaningful symbolic constants to represent literal values in program logicDCL13-CPP. Declare function parameters that are pointers to values not changed by the function as constDCL30-CPP. Declare objects with appropriate storage durationsEXP06-CPP. Operands to the sizeof operator should not contain side effectsEXP09-CPP. Use sizeof to determine the size of a type or variableEXP12-CPP. Do not ignore values returned by functions or methodsEXP15-CPP. Beware of integer promotion when performing bitwise operations on chars or shortsEXP19-CPP. Do not perform assignments in conditional expressionsEXP30-CPP. Do not depend on order of evaluation between sequence pointsEXP32-CPP. Do not access a volatile object through a non-volatile referenceEXP35-CPP. Do not cast away a const qualificationEXP36-CPP. Do not convert pointers into more strictly aligned pointer typesEXP37-CPP. Call variadic functions with the arguments intended by the APIINT07-CPP. Use only explicitly signed or unsigned char type for numeric valuesINT09-CPP. Ensure enumeration constants map to unique valuesINT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expressionINT13-CPP. Use bitwise operators only on unsigned operandsINT30-CPP. Ensure that unsigned integer operations do not wrapINT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted dataINT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errorsINT34-CPP. Do not shift a negative number of bits or more bits than exist in the operandFLP30-CPP. Do not use floating point variables as loop countersFLP34-CPP. Ensure that floating point conversions are within range of the new typeARR01-CPP. Do not apply the sizeof operator to a pointer when taking the size of an arrayARR02-CPP. Explicitly specify array bounds, even if implicitly defined by an initializerARR30-CPP. Guarantee that array and vector indices are within the valid rangeSTR04-CPP. Use plain char for characters in the basic character setSTR34-CPP. Cast characters to unsigned types before converting to larger integer sizesSTR36-CPP. Do not specify the bound of a character array initialized with a string literalSTR37-CPP. Arguments to character handling functions must be representable as an unsigned charMEM02-CPP. Immediately cast the result of a memory allocation function call into a pointer to the allocated typeFIO07-CPP. Prefer fseek() to rewind()FIO12-CPP. Prefer setvbuf() to setbuf()FIO30-CPP. Exclude user input from format stringsFIO32-CPP. Do not perform operations on devices that are only appropriate for filesFIO37-CPP. Do not assume character data has been readFIO38-CPP. Do not use a copy of a FILE object for input and outputFIO39-CPP. Do not alternately input and output from a stream without an intervening flush or positioning callFIO44-CPP. Only use values for fsetpos() that are returned from fgetpos()MSC05-CPP. Do not manipulate time_t typed values directlyMSC18-CPP. Finish every set of statements associated with a case label with a break statementMSC30-CPP. Do not use the rand() function for generating pseudorandom numbers