Versions Compared

Key

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

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

Version number:
5.0 

was automatically generated 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
LDRA_V
LDRA_V

Checker

Guideline

1 J EXP54-CPP. Do not access an object outside of its lifetime
1 Q EXP50

C++ checkers

Rule

134 S

EXP30-CPP. Do not depend on order of evaluation between sequence points

1 Q

EXP30-CPP. Do not depend on the order of evaluation between sequence points

248 S

INT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errors

344 S

EXP32-CPP. Do not access a volatile object through a non-volatile reference

for side effects
2 D MSC52-CPP. Value-returning functions must return a value from all exit paths
6 D DCL56-CPP. Avoid cycles during initialization of static objects
9 S EXP50-CPP. Do not depend on the order of evaluation for side effects
35 D EXP50

35 D

EXP30-CPP. Do not depend on the order of evaluation between sequence pointsfor side effects
36 S MSC52-CPP. Value-returning functions must return a value from all exit paths
41 S DCL50

39 S

FLP30-CPP. Do not use floating point variables as loop countersdefine a C-style variadic function
42 D DCL30 EXP54-CPP. Declare objects with appropriate storage durations

433 S

INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data

434 S

INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data

43 D

INT32-CPP. Ensure that operations on signed integers do not result in overflow

43 D

INT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errors

493 S

INT32-CPP. Ensure that operations on signed integers do not result in overflow

494 S

INT32-CPP. Ensure that operations on signed integers do not result in overflow

573 S

PRE30-CPP. Do not create a universal character name through concatenation

575 S

DCL36-CPP. Do not declare an identifier with conflicting linkage classifications

591 S

FIO38-CPP. Do not use a copy of a FILE object for input and output

71 S

DCL30-CPP. Declare objects with appropriate storage durations

75 D

FIO31-CPP. Do not simultaneously open the same file multiple times

82 D

FIO44-CPP. Only use values for fsetpos() that are returned from fgetpos()

84 D

FIO39-CPP. Do not alternately input and output from a stream without an intervening flush or positioning call

86 D

FIO30-CPP. Exclude user input from format strings

93 S

INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data

9 S

EXP30-CPP. Do not depend on order of evaluation between sequence points

 

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

 

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

Do not access an object outside of its lifetime
43 S ERR52-CPP. Do not use setjmp() or longjmp()
44 S OOP57-CPP. Prefer special member functions and overloaded operators to C Standard Library functions
44 S MSC50-CPP. Do not use std::rand() for generating pseudorandom numbers
45 D CTR50-CPP. Guarantee that container indices and iterators are within the valid range
45 D MEM52-CPP. Detect and handle memory allocation errors
47 S CTR50-CPP. Guarantee that container indices and iterators are within the valid range
50 D ERR57-CPP. Do not leak resources when handling exceptions
53 D EXP53-CPP. Do not read uninitialized memory
53 D EXP54-CPP. Do not access an object outside of its lifetime
54 S EXP52-CPP. Do not rely on side effects in unevaluated operands
56 D ERR55-CPP. Honor exception specifications
56 D ERR56-CPP. Guarantee exception safety
64 D MEM51-CPP. Properly deallocate dynamically allocated resources
64 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
66 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
66 X STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator
67 D EXP50-CPP. Do not depend on the order of evaluation for side effects
68 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
69 D EXP53-CPP. Do not read uninitialized memory
69 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
70 S CTR54-CPP. Do not subtract iterators that do not refer to the same container
70 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
70 X STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator
71 D ERR56-CPP. Guarantee exception safety
71 S EXP54-CPP. Do not access an object outside of its lifetime
71 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
71 X STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator
72 D EXP50-CPP. Do not depend on the order of evaluation for side effects
77 D EXP54-CPP. Do not access an object outside of its lifetime
79 X CTR50-CPP. Guarantee that container indices and iterators are within the valid range
86 S DCL51-CPP. Do not declare or define a reserved identifier
87 S CTR54-CPP. Do not subtract iterators that do not refer to the same container
92 D OOP50-CPP. Do not invoke virtual functions from constructors or destructors
112 D MEM51-CPP. Properly deallocate dynamically allocated resources
122 S ERR50-CPP. Do not abruptly terminate the program
133 S EXP52-CPP. Do not rely on side effects in unevaluated operands
134 S EXP50-CPP. Do not depend on the order of evaluation for side effects
169 S EXP57-CPP. Do not cast or delete pointers to incomplete classes
203 S EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type
206 S OOP53-CPP. Write constructor member initializers in the canonical order
218 S DCL51-CPP. Do not declare or define a reserved identifier
219 S DCL51-CPP. Do not declare or define a reserved identifier
232 S MEM51-CPP. Properly deallocate dynamically allocated resources
236 S MEM51-CPP. Properly deallocate dynamically allocated resources
239 S MEM51-CPP. Properly deallocate dynamically allocated resources
242 S EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type
286 S DCL59-CPP. Do not define an unnamed namespace in a header file
286 S DCL60-CPP. Obey the one-definition rule
287 S DCL60-CPP. Obey the one-definition rule
296 S DCL53-CPP. Do not write syntactically ambiguous declarations
303 S OOP52-CPP. Do not delete a polymorphic object without a virtual destructor
344 S EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type
407 S MEM51-CPP. Properly deallocate dynamically allocated resources
437 S CTR54-CPP. Do not subtract iterators that do not refer to the same container
438 S CTR54-CPP. Do not subtract iterators that do not refer to the same container
453 S DCL57-CPP. Do not let exceptions escape from destructors or deallocation functions
455 S ERR61-CPP. Catch exceptions by lvalue reference
467 S OOP50-CPP. Do not invoke virtual functions from constructors or destructors
469 S MEM51-CPP. Properly deallocate dynamically allocated resources
470 S MEM51-CPP. Properly deallocate dynamically allocated resources
476 S CTR50-CPP. Guarantee that container indices and iterators are within the valid range
483 S MEM50-CPP. Do not access freed memory
483 S MEM51-CPP. Properly deallocate dynamically allocated resources
484 S MEM50-CPP. Do not access freed memory
484 S MEM51-CPP. Properly deallocate dynamically allocated resources
485 S MEM51-CPP. Properly deallocate dynamically allocated resources
489 S CTR50-CPP. Guarantee that container indices and iterators are within the valid range
489 S STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator
512 S DCL59-CPP. Do not define an unnamed namespace in a header file
527 S ERR51-CPP. Handle all exceptions
527 S ERR56-CPP. Guarantee exception safety
541 S ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived
549 S ERR53-CPP. Do not reference base classes or class data members in a constructor or destructor function-try-block handler
554 S EXP57-CPP. Do not cast or delete pointers to incomplete classes
556 S ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived
565 S EXP54-CPP. Do not access an object outside of its lifetime
567 S CTR55-CPP. Do not use an additive operator on an iterator if the result would overflow
567 S CTR56-CPP. Do not use pointer arithmetic on polymorphic objects
580 S DCL51-CPP. Do not declare or define a reserved identifier
597 S MEM54-CPP. Provide placement new with properly aligned pointers to sufficient storage capacity
618 S EXP62-CPP. Do not access the bits of an object representation that are not part of the object's value representation
631 S EXP53-CPP. Do not read uninitialized memory
652 S EXP53-CPP. Do not read uninitialized memory

 

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