Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Checker

Guideline

-q & Name CheckMSC34MSC53-CPP. Do not modify the standard namespacenamespaces
-wc "::FILE::@constructor"strtokSTR06FIO38-CPP. Do not use a copy of a FILE object for input and output
-wc "::std::vector::[]"STR39-CPP. Range check element access
-wc randMSC30-CPP. Do not use the rand() function for generating pseudorandom numbers
-wc strtokSTR06-CPP. Do not assume that strtok() leaves the parse string unchanged
0064PRE30-CPP. Do not create a universal character name through concatenation
0103, 0105, 0106, 0293,254DCL36-CPP. Do not declare an identifier with conflicting linkage classifications
0424EXP38-CPP. Do not modify constant values
0600,0601,1038,1039PRE05-CPP. Understand macro replacement when concatenating tokens or performing stringification
1000,1001PRE06-CPP. Enclose header files in an inclusion guard
assume that strtok() leaves the parse string unchanged
0600PRE05-CPP. Understand macro replacement when concatenating tokens or performing stringification
0601PRE05-CPP. Understand macro replacement when concatenating tokens or performing stringification
1000PRE06-CPP. Enclose header files in an inclusion guard
1001PRE06-CPP. Enclose header files in an inclusion guard
1020PRE00-CPP. Avoid defining macros
1021PRE00-CPP. Avoid defining macros
1025DCL00-CPP. Const-qualify immutable objects
1025PRE00-CPP. Avoid defining macros
1026DCL00-CPP. Const-qualify immutable objects
1020,1021, 1025, 1026PRE00-CPP. Avoid defining macros1023PRE10-CPP. Wrap multistatement macros in a do-while loop
1025,1026DCL00-CPP. Const-qualify immutable objects
1030PRE01-CPP. Use parentheses within macros around parameter names
1031PRE02-CPP. Macro replacement lists should be parenthesized
1038MSC14-CPP. Do not introduce unnecessary platform dependencies
1038PRE05-CPP. Understand macro replacement when concatenating tokens or performing stringification
1039,1039,1100,2075,MSC14-CPP. Do not introduce unnecessary platform dependencies
1039PRE05-CPP. Understand macro replacement when concatenating tokens or performing stringification
1067MSC33MSC52-CPP. Obey the One Definition Ruleone-definition rule
1092PRE07-CPP. Avoid using repeated question marks
1095MSC09-CPP. Character encoding: Use subset of ASCII for safety
141100DCL33MSC14-CPP. Do not introduce unnecessary platform dependencies
14DCL52-CPP. Never qualify a reference Never qualify a reference type with const or volatile145, 2845, 2846, 2847,
STR31-CPP. Guarantee that storage for character arrays has sufficient space for character data and the null terminator150STR04-CPP. Use plain char for characters in the basic character set
1500,1502,2980,2981,MSC13-CPP. Detect and remove unused values1501,1503,2880,2881,
1502MSC13MSC07-CPP. Detect and remove dead codeunused values
1504DCL07-CPP. Minimize the scope of variables and methods
15041504, 1505, 1514, 1531, 1532, 1533, 2300, 2313, 2314DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1504,1505,1531,1533,4113, 4114DCL07-CPP. Minimize the scope of variables and methods
1505DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1509MSC33MSC52-CPP. Obey the One Definition Ruleone-definition rule
1514DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1515PRE08-CPP. Guarantee that header file names are unique
1516PRE08-CPP. Guarantee that header file names are unique
1515, 1516, 1517PRE08-CPP. Guarantee that header file names are unique
1520MEM05-CPP. Avoid large stack allocations
,1521MEM05-CPP. Avoid large stack allocations
1554, 1555, 1556, 1557, 1558,DCL14-CPP. Avoid assumptions about the initialization order between translation units
1559DCL14-CPP. Avoid assumptions about the initialization order between translation units
1710 - but needs -po optionsDCL02-CPP. Use visually distinct identifiers
2001MEM13-CPP. Use smart pointers instead of raw pointers for resource management
2009DCL17-CPP. Declare function parameters that are large data structures and are not changed by the function as const references
2010DCL17-CPP. Declare function parameters that are large data structures and are not changed by the function as const references
2012DCL31-CPP. Do not define variadic functions
2019OOP04-CPP. Prefer not to give virtual functions default argument initializers
2070,2071,2072,2073,2074,DCL11-CPP. Preserve operator semantics when overloading operators
2076,2085,2114,2125,MSC14-CPP. Do not introduce unnecessary platform dependencies
2077,2078,DCL10-CPP. Do not overload the ampersand, comma, logical AND or logical OR operators
2079,2092DCL10-CPP. Do not overload the ampersand, comma, logical AND or logical OR operators
2081,2082, 2090, 2097DCL11-CPP. Preserve operator semantics when overloading operators
2100,2101OOP00-CPP. Declare data members private
2110,2111,2112,2113,MEM41-CPP. Declare a copy constructor, a copy assignment operator, and a destructor in a class that manages resources
2110,2112,2113OOP06-CPP. Create a private copy constructor and assignment operator for non copyable objects
2116OOP34-CPP. Ensure the proper destructor is called for polymorphic objects
2118.4262.4263.4264MEM41-CPP. Declare a copy constructor, a copy assignment operator, and a destructor in a class that manages resources
2120OOP03-CPP. Prefer not to overload virtual functions
2121OOP02-CPP. Do not hide inherited non-virtual member functions
2139,2178,2200,2201,MSC14-CPP. Do not introduce unnecessary platform dependencies
2159OOP07-CPP. Do not inherit from multiple classes that have distinct objects with the same name
2160,2161DCL35-CPP. Do not overload operator new in a different scope than operator delete
2180OOP32-CPP. Ensure that single-argument constructors are marked "explicit"
2181OOP01-CPP. Be careful with the definition of conversion operators
1530MEM08-CPP. Use new and delete rather than raw memory allocation and deallocation
1531DCL07-CPP. Minimize the scope of variables and methods
1531DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1532DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1533DCL07-CPP. Minimize the scope of variables and methods
1533DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
1550DCL14-CPP. Avoid assumptions about the initialization order between translation units
1551DCL14-CPP. Avoid assumptions about the initialization order between translation units
1552DCL14-CPP. Avoid assumptions about the initialization order between translation units
1553DCL14-CPP. Avoid assumptions about the initialization order between translation units
1554DCL14-CPP. Avoid assumptions about the initialization order between translation units
1555DCL14-CPP. Avoid assumptions about the initialization order between translation units
1556DCL14-CPP. Avoid assumptions about the initialization order between translation units
1557DCL14-CPP. Avoid assumptions about the initialization order between translation units
1558DCL14-CPP. Avoid assumptions about the initialization order between translation units
1559DCL14-CPP. Avoid assumptions about the initialization order between translation units
1710DCL02-CPP. Use visually distinct identifiers
1808DCL04-CPP. Do not declare more than one variable per declaration
2001MEM13-CPP. Use smart pointers instead of raw pointers for resource management
2009DCL17-CPP. Declare function parameters that are large data structures and are not changed by the function as const references
2010DCL17-CPP. Declare function parameters that are large data structures and are not changed by the function as const references
2012DCL50-CPP. Do not define a C-style variadic function
2019OOP04-CPP. Prefer not to give virtual functions default argument initializers
2070DCL11-CPP. Preserve operator semantics when overloading operators
2071DCL11-CPP. Preserve operator semantics when overloading operators
2072DCL11-CPP. Preserve operator semantics when overloading operators
2073DCL11-CPP. Preserve operator semantics when overloading operators
2074DCL11-CPP. Preserve operator semantics when overloading operators
2075MSC14-CPP. Do not introduce unnecessary platform dependencies
20762202,2413,2640,3017,MSC14-CPP. Do not introduce unnecessary platform dependencies2304,2306,2307,2308,2309
2077DCL10INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2310, 1550, 1551, 1552, 1553,DCL14-CPP. Avoid assumptions about the initialization order between translation units
2410,2411ARR00-CPP. Understand when to prefer vectors over arrays
2422,2423INT09-CPP. Ensure enumeration constants map to unique values
2426DCL05-CPP. Use typedefs to improve code readability
2427,2428PRE03-CPP. Prefer typedefs to defines for encoding types
2500,2501,2502,2503,2504,2505DCL01-CPP. Do not reuse variable names in subscopes
2502DCL18-CPP. In a class template, qualify any name that may be found in a dependent base class template
2510OOP31-CPP. Ensure object construction invocations isn't mistaken for a function variable declaration
2515, 2516, 2527, 2528, 4028, 4624, 4629DCL30-CPP. Declare objects with appropriate storage durations
2624OOP04-CPP. Prefer not to give virtual functions default argument initializers
2625DCL31-CPP. Do not define variadic functions
2761,2762,2763,2766,ARR36-CPP. Do not subtract or compare two pointers or iterators that do not refer to the same array or container
2767,2768,2771,2772,ARR36-CPP. Do not subtract or compare two pointers or iterators that do not refer to the same array or container
2773ARR36-CPP. Do not subtract or compare two pointers or iterators that do not refer to the same array or container
2791,2792,2793,,3321,3322INT34-CPP. Do not shift a negative number of bits or more bits than exist in the operand
2800,2801,2802,2803INT32-CPP. Ensure that operations on signed integers do not result in overflow
2800,2801,2802,2803,INT08-CPP. Verify that all integer values are in range
2810,2811,2812,2813,EXP34-CPP. Ensure a null pointer is not dereferenced
2814,2820,2821,2822,EXP34-CPP. Ensure a null pointer is not dereferenced
2823,2824EXP34-CPP. Ensure a null pointer is not dereferenced
2831,2832,2833,2834INT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errors
2840, 2841, 2842, 2843, 2844EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2848, 2849STR31-CPP. Guarantee that storage for character arrays has sufficient space for character data and the null terminator
2882,2883,2877,2032,MSC07-CPP. Detect and remove dead code
2910,2911,2912,2913INT08-CPP. Verify that all integer values are in range
2910,2911,2912,2913INT30-CPP. Ensure that unsigned integer operations do not wrap
2930, 2931, 2932, 2933,ARR38-CPP. Do not add or subtract an integer to a pointer or iterator if the resulting value does not refer to a valid element in the array or container
2934, 2950, 2951, 2952,ARR38-CPP. Do not add or subtract an integer to a pointer or iterator if the resulting value does not refer to a valid element in the array or container
2940,2941,2942,2943,INT16-CPP. Do not make assumptions about representation of signed integers
2945,2946,2947,2948INT16-CPP. Do not make assumptions about representation of signed integers
2953ARR38-CPP. Do not add or subtract an integer to a pointer or iterator if the resulting value does not refer to a valid element in the array or container
2961,2962,2963,2966,EXP33-CPP. Do not reference uninitialized memory
2967,2968,2971,2972,EXP33-CPP. Do not reference uninitialized memory
2973,2976, 2977, 2978EXP33-CPP. Do not reference uninitialized memory
2980,2981,2982,2983,MSC07-CPP. Detect and remove dead code
2982,2983,2984,2985,MSC13-CPP. Detect and remove unused values
2984,2985,2986,3099,MSC07-CPP. Detect and remove dead code
2986MSC13-CPP. Detect and remove unused values
3000,3001,3002,3003,3005,3006,3007,3010,3011,3012,3015,3016INT02-CPP. Understand integer conversion rules
3001STR07-CPP. Don't assume numeric values for expressions with type plain character
3003,3004INT13-CPP. Use bitwise operators only on unsigned operands
3010,3000,2850,2851,2852,2853,2855-2858,2890-2898,2900,2901,2901,2903,2905,2906,2907,2908INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data
3011FLP33-CPP. Convert integers to floating point for floating point operations
3011FLP34-CPP. Ensure that floating point conversions are within range of the new type
3011FLP36-CPP. Beware of precision loss when converting integral types to floating point
3013INT36-CPP. Do not use out-of-range enumeration values
3017EXP11-CPP. Do not apply operators expecting one type to data of an incompatible type
3030EXP11-CPP. Do not apply operators expecting one type to data of an incompatible type
3033,3038EXP36-CPP. Do not convert pointers into more strictly aligned pointer types
3044,3045INT11-CPP. Take care when converting from pointer to integer or integer to pointer
3051STR34-CPP. Cast characters to unsigned types before converting to larger integer sizes
3058MSC02-CPP. Avoid errors of omission
3060,3083EXP35-CPP. Do not cast away a const qualification
3061EXP32-CPP. Do not access a volatile object through a non-volatile reference
3062EXP38-CPP. Do not modify constant values
3063,3064STR05-CPP. Use pointers to const when referring to string literals
3063,3064,3605,STR30-CPP. Do not attempt to modify string literals
3072,3073ARR39-CPP. Do not treat arrays polymorphically
3072,3073OOP33-CPP. Do not slice polymorphic objects
3076EXP13-CPP. Prefer dynamic_cast over static_cast over reinterpret_cast
3080,3082EXP05-CPP. Do not use C-style casts
3090EXP14-CPP. Do not use reinterpret_cast on pointers to class objects with multiple inheritence
3100,3101,3102,4017MSC07-CPP. Detect and remove dead code
3220,3221,3222,3223EXP10-CPP. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
3220,3221,3222,3223EXP30-CPP. Do not depend on order of evaluation between sequence points
3224ERR01-CPP. Use ferror() rather than errno to check for FILE stream errors
3230EXP02-CPP. Be aware of the short-circuit behavior of the logical AND and OR operators
3231EXP02-CPP. Be aware of the short-circuit behavior of the logical AND and OR operators
3240EXP06-CPP. Operands to the sizeof operator should not contain side effects
3242,3243,3244,MSC03-CPP. Avoid errors of addition
3244,3245MSC12-CPP. Detect and remove code that has no effect
3245,4060MSC03-CPP. Avoid errors of addition
3247,3248,3249,3250,MSC14-CPP. Do not introduce unnecessary platform dependencies
3270FLP35-CPP. Take granularity into account when comparing floating point values
3290EXP18-CPP. Prefer the prefix forms of ++ and --
3292EXP18-CPP. Prefer the prefix forms of ++ and --
3301OOP05-CPP. Avoid deleting this
3320,3400,3401MSC14-CPP. Do not introduce unnecessary platform dependencies
3330,3331,3332,3334,1530MEM39-CPP. Resources allocated by memory allocation functions must be released using the corresponding memory deallocation function
3332,3334,1530,3968MEM08-CPP. Use new and delete rather than raw memory allocation and deallocation
3337,3338,3339MEM11-CPP. Allocate and free memory in the same module, at the same level of abstraction
3337,3338,3339MEM31-CPP. Free dynamically allocated memory exactly once
3403OOP34-CPP. Ensure the proper destructor is called for polymorphic objects
3500,3505,3506,ERR08-CPP. Prefer special-purpose types for exceptions
3507,4033ERR08-CPP. Prefer special-purpose types for exceptions
3508ERR14-CPP. Do not allow an exception class's copy constructor to throw exceptions
3510ERR35-CPP. A handler in a constructor or destructor's function-try-block should not reference class data
3606,3607STR30-CPP. Do not attempt to modify string literals
3700,3702,3703EXP00-CPP. Use parentheses for precedence of operation
3700,3709EXP17-CPP. Treat relational and equality operators as if they were nonassociative
3705EXP08-CPP. Ensure pointer arithmetic is used correctly
3705,3706,3707ARR37-CPP. Do not add or subtract an integer to a pointer to a non-array object
3706EXP08-CPP. Ensure pointer arithmetic is used correctly
3708FLP02-CPP. Avoid using floating point numbers when precise computation is needed
3715,3716,3717INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
3802EXP12-CPP. Do not ignore values returned by functions or methods
4011MSC18-CPP. Finish every set of statements associated with a case label with a break statement
4013,4014MSC20-CPP. Do not use a switch statement to transfer control into a complex block
4024, 4028, 4625,OOP35-CPP. Do not return references to private data
4031ERR09-CPP. Throw anonymous temporaries and catch by reference
4032,4631,4633,3509ERR33-CPP. Destructors must not throw exceptions
4037,4038,4636,4637ERR30-CPP. Try to recover gracefully from unexpected errors
4040,4034ERR36-CPP. Multiple catch handlers to a try block should order their exceptions from most derived to most basic
4053,4056,4058OOP37-CPP. Constructor initializers should be ordered correctly
4070MSC01-CPP. Strive for logical completeness
4071EXP19-CPP. Do not perform assignments in conditional expressions
4071MSC02-CPP. Avoid errors of omission
4072,4073,4075,4076MEM42-CPP. Ensure that copy assignment operators do not damage an object that is copied to itself
4075,4076ERR39-CPP. Guarantee exception safety
4090DCL03-CPP. Use a static assertion to test the value of a constant expression
4101, 4102, 4206, 4207, 4218,DCL19-CPP. Initialize automatic local variables on declaration
4107, 4108, 1808DCL04-CPP. Do not declare more than one variable per declaration
4213,4283DCL13-CPP. Declare function parameters that are pointers to values not changed by the function as const
4219, 4265, 4269, 4270, 4271, 4272DCL19-CPP. Initialize automatic local variables on declaration
4234FLP30-CPP. Do not use floating point variables as loop counters
424MEM02-CPP. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
4260,4261,4273,4274,OOP30-CPP. Do not invoke virtual functions from constructors or destructors
4275,4276,4277,4278,OOP30-CPP. Do not invoke virtual functions from constructors or destructors
4279,4280,4281,4282OOP30-CPP. Do not invoke virtual functions from constructors or destructors
4400,4401,4402,4403,4404,4405,4406,4408,4409,4414,4415DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4400,4401,4405EXP07-CPP. Do not diminish the benefits of constants by assuming their values in expressions
4610,4611MSC01-CPP. Strive for logical completeness
4626, 4627, 4628OOP35-CPP. Do not return references to private data
overload the ampersand, comma, logical AND or logical OR operators
2078DCL10-CPP. Do not overload the ampersand, comma, logical AND or logical OR operators
2079DCL10-CPP. Do not overload the ampersand, comma, logical AND or logical OR operators
2081DCL11-CPP. Preserve operator semantics when overloading operators
2082DCL11-CPP. Preserve operator semantics when overloading operators
2085MSC14-CPP. Do not introduce unnecessary platform dependencies
2090DCL11-CPP. Preserve operator semantics when overloading operators
2092DCL10-CPP. Do not overload the ampersand, comma, logical AND or logical OR operators
2097DCL11-CPP. Preserve operator semantics when overloading operators
2100OOP00-CPP. Declare data members private
2101OOP00-CPP. Declare data members private
2110OOP06-CPP. Create a private copy constructor and assignment operator for non copyable objects
2112OOP06-CPP. Create a private copy constructor and assignment operator for non copyable objects
2113OOP06-CPP. Create a private copy constructor and assignment operator for non copyable objects
2114MSC14-CPP. Do not introduce unnecessary platform dependencies
2116OOP52-CPP. Do not delete a polymorphic object without a virtual destructor
2120OOP03-CPP. Prefer not to overload virtual functions
2121OOP02-CPP. Do not hide inherited non-virtual member functions
2125MSC14-CPP. Do not introduce unnecessary platform dependencies
2139MSC14-CPP. Do not introduce unnecessary platform dependencies
2159OOP07-CPP. Do not inherit from multiple classes that have distinct objects with the same name
2160DCL54-CPP. Overload allocation and deallocation functions as a pair in the same scope
2161DCL54-CPP. Overload allocation and deallocation functions as a pair in the same scope
2178MSC14-CPP. Do not introduce unnecessary platform dependencies
2180OOP09-CPP. Ensure that single-argument constructors are marked "explicit"
2181OOP01-CPP. Be careful with the definition of conversion operators
2200MSC14-CPP. Do not introduce unnecessary platform dependencies
2201MSC14-CPP. Do not introduce unnecessary platform dependencies
2202MSC14-CPP. Do not introduce unnecessary platform dependencies
2300DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
2304INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2306INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2307INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2308INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2309INT12-CPP. Do not make assumptions about the type of a plain int bit-field when used in an expression
2310DCL14-CPP. Avoid assumptions about the initialization order between translation units
2313DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
2314DCL15-CPP. Declare file-scope objects or functions that do not need external linkage in an unnamed namespace
2410CTR00-CPP. Understand when to prefer vectors over arrays
2411CTR00-CPP. Understand when to prefer vectors over arrays
2413MSC14-CPP. Do not introduce unnecessary platform dependencies
2422INT09-CPP. Ensure enumeration constants map to unique values
2423INT09-CPP. Ensure enumeration constants map to unique values
2426DCL05-CPP. Use typedefs to improve code readability
2427PRE03-CPP. Prefer typedefs to defines for encoding types
2428PRE03-CPP. Prefer typedefs to defines for encoding types
2500DCL01-CPP. Do not reuse variable names in subscopes
2501DCL01-CPP. Do not reuse variable names in subscopes
2502DCL01-CPP. Do not reuse variable names in subscopes
2503DCL01-CPP. Do not reuse variable names in subscopes
2504DCL01-CPP. Do not reuse variable names in subscopes
2505DCL01-CPP. Do not reuse variable names in subscopes
2510DCL53-CPP. Do not write syntactically ambiguous declarations
2624OOP04-CPP. Prefer not to give virtual functions default argument initializers
2625DCL50-CPP. Do not define a C-style variadic function
2640MSC14-CPP. Do not introduce unnecessary platform dependencies
2761CTR54-CPP. Do not subtract iterators that do not refer to the same container
2762CTR54-CPP. Do not subtract iterators that do not refer to the same container
2763CTR54-CPP. Do not subtract iterators that do not refer to the same container
2766CTR54-CPP. Do not subtract iterators that do not refer to the same container
2767CTR54-CPP. Do not subtract iterators that do not refer to the same container
2768CTR54-CPP. Do not subtract iterators that do not refer to the same container
2771CTR54-CPP. Do not subtract iterators that do not refer to the same container
2772CTR54-CPP. Do not subtract iterators that do not refer to the same container
2773CTR54-CPP. Do not subtract iterators that do not refer to the same container
2800INT08-CPP. Verify that all integer values are in range
2801INT08-CPP. Verify that all integer values are in range
2802INT08-CPP. Verify that all integer values are in range
2803INT08-CPP. Verify that all integer values are in range
2840EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2841EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2842EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2843EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2844EXP03-CPP. Do not assume the size of a class or struct is the sum of the sizes of its members
2910INT08-CPP. Verify that all integer values are in range
2911INT08-CPP. Verify that all integer values are in range
2912INT08-CPP. Verify that all integer values are in range
2913INT08-CPP. Verify that all integer values are in range
2940INT16-CPP. Do not make assumptions about representation of signed integers
2941INT16-CPP. Do not make assumptions about representation of signed integers
2942INT16-CPP. Do not make assumptions about representation of signed integers
2943INT16-CPP. Do not make assumptions about representation of signed integers
2945INT16-CPP. Do not make assumptions about representation of signed integers
2946INT16-CPP. Do not make assumptions about representation of signed integers
2947INT16-CPP. Do not make assumptions about representation of signed integers
2948INT16-CPP. Do not make assumptions about representation of signed integers
2980MSC13-CPP. Detect and remove unused values
2981MSC13-CPP. Detect and remove unused values
2982MSC13-CPP. Detect and remove unused values
2983MSC13-CPP. Detect and remove unused values
2984MSC13-CPP. Detect and remove unused values
2985MSC13-CPP. Detect and remove unused values
2986MSC13-CPP. Detect and remove unused values
3000INT02-CPP. Understand integer conversion rules
3001INT02-CPP. Understand integer conversion rules
3001STR07-CPP. Don't assume numeric values for expressions with type plain character
3002INT02-CPP. Understand integer conversion rules
3003INT02-CPP. Understand integer conversion rules
3003INT13-CPP. Use bitwise operators only on unsigned operands
3004INT13-CPP. Use bitwise operators only on unsigned operands
3005INT02-CPP. Understand integer conversion rules
3006INT02-CPP. Understand integer conversion rules
3007INT02-CPP. Understand integer conversion rules
3010INT02-CPP. Understand integer conversion rules
3011FLP05-CPP. Convert integers to floating point for floating point operations
3011INT02-CPP. Understand integer conversion rules
3012INT02-CPP. Understand integer conversion rules
3015INT02-CPP. Understand integer conversion rules
3016INT02-CPP. Understand integer conversion rules
3017EXP11-CPP. Do not apply operators expecting one type to data of an incompatible type
3017MSC14-CPP. Do not introduce unnecessary platform dependencies
3030EXP11-CPP. Do not apply operators expecting one type to data of an incompatible type
3044INT11-CPP. Take care when converting from pointer to integer or integer to pointer
3045INT11-CPP. Take care when converting from pointer to integer or integer to pointer
3058MSC02-CPP. Avoid errors of omission
3063STR05-CPP. Use pointers to const when referring to string literals
3064STR05-CPP. Use pointers to const when referring to string literals
3072CTR56-CPP. Do not use pointer arithmetic on polymorphic objects
3072OOP51-CPP. Do not slice derived objects
3073CTR56-CPP. Do not use pointer arithmetic on polymorphic objects
3073OOP51-CPP. Do not slice derived objects
3076EXP13-CPP. Prefer dynamic_cast over static_cast over reinterpret_cast
3080EXP05-CPP. Do not use C-style casts
3082EXP05-CPP. Do not use C-style casts
3090EXP14-CPP. Do not use reinterpret_cast on pointers to class objects with multiple inheritence
3220EXP50-CPP. Do not depend on the order of evaluation for side effects
3221EXP50-CPP. Do not depend on the order of evaluation for side effects
3222EXP50-CPP. Do not depend on the order of evaluation for side effects
3223EXP50-CPP. Do not depend on the order of evaluation for side effects
3224ERR01-CPP. Use ferror() rather than errno to check for FILE stream errors
3230EXP02-CPP. Be aware of the short-circuit behavior of the logical AND and OR operators
3231EXP02-CPP. Be aware of the short-circuit behavior of the logical AND and OR operators
3242MSC03-CPP. Avoid errors of addition
3243MSC03-CPP. Avoid errors of addition
3244MSC03-CPP. Avoid errors of addition
3244MSC12-CPP. Detect and remove code that has no effect
3245MSC03-CPP. Avoid errors of addition
3245MSC12-CPP. Detect and remove code that has no effect
3247MSC14-CPP. Do not introduce unnecessary platform dependencies
3248MSC14-CPP. Do not introduce unnecessary platform dependencies
3249MSC14-CPP. Do not introduce unnecessary platform dependencies
3250MSC14-CPP. Do not introduce unnecessary platform dependencies
3290EXP18-CPP. Prefer the prefix forms of ++ and --
3292EXP18-CPP. Prefer the prefix forms of ++ and --
3301OOP05-CPP. Avoid deleting this
3320MSC14-CPP. Do not introduce unnecessary platform dependencies
3332MEM08-CPP. Use new and delete rather than raw memory allocation and deallocation
3334MEM08-CPP. Use new and delete rather than raw memory allocation and deallocation
3400MSC14-CPP. Do not introduce unnecessary platform dependencies
3401MSC14-CPP. Do not introduce unnecessary platform dependencies
3403OOP52-CPP. Do not delete a polymorphic object without a virtual destructor
3500ERR08-CPP. Prefer special-purpose types for exceptions
3505ERR08-CPP. Prefer special-purpose types for exceptions
3506ERR08-CPP. Prefer special-purpose types for exceptions
3507ERR08-CPP. Prefer special-purpose types for exceptions
3508ERR60-CPP. Exception objects must be nothrow copy constructible
3510ERR53-CPP. Do not reference base classes or class data members in a constructor or destructor function-try-block handler
3700EXP00-CPP. Use parentheses for precedence of operation
3700EXP17-CPP. Treat relational and equality operators as if they were nonassociative
3702EXP00-CPP. Use parentheses for precedence of operation
3703EXP00-CPP. Use parentheses for precedence of operation
3705EXP08-CPP. Ensure pointer arithmetic is used correctly
3706EXP08-CPP. Ensure pointer arithmetic is used correctly
3708FLP02-CPP. Avoid using floating point numbers when precise computation is needed
3709EXP17-CPP. Treat relational and equality operators as if they were nonassociative
3715INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
3716INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
3717INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
3802EXP12-CPP. Do not ignore values returned by functions or methods
3968MEM08-CPP. Use new and delete rather than raw memory allocation and deallocation
4011MSC18-CPP. Finish every set of statements associated with a case label with a break statement
4013MSC20-CPP. Do not use a switch statement to transfer control into a complex block
4014MSC20-CPP. Do not use a switch statement to transfer control into a complex block
4024OOP08-CPP. Do not return references to private data
4028OOP08-CPP. Do not return references to private data
4031ERR09-CPP. Throw anonymous temporaries
4033ERR08-CPP. Prefer special-purpose types for exceptions
4034ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived
4037ERR50-CPP. Do not call std::terminate(), std::abort(), or std::_Exit()
4038ERR50-CPP. Do not call std::terminate(), std::abort(), or std::_Exit()
4040ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived
4053OOP53-CPP. Write constructor member initializers in the canonical order
4056OOP53-CPP. Write constructor member initializers in the canonical order
4058OOP53-CPP. Write constructor member initializers in the canonical order
4060MSC03-CPP. Avoid errors of addition
4070MSC01-CPP. Strive for logical completeness
4071EXP19-CPP. Do not perform assignments in conditional expressions
4071MSC02-CPP. Avoid errors of omission
4072OOP54-CPP. Gracefully handle self-assignment
4073OOP54-CPP. Gracefully handle self-assignment
4075ERR56-CPP. Guarantee exception safety
4075OOP54-CPP. Gracefully handle self-assignment
4076ERR56-CPP. Guarantee exception safety
4076OOP54-CPP. Gracefully handle self-assignment
4090DCL03-CPP. Use a static assertion to test the value of a constant expression
4101DCL19-CPP. Initialize automatic local variables on declaration
4102DCL19-CPP. Initialize automatic local variables on declaration
4107DCL04-CPP. Do not declare more than one variable per declaration
4108DCL04-CPP. Do not declare more than one variable per declaration
4113DCL07-CPP. Minimize the scope of variables and methods
4114DCL07-CPP. Minimize the scope of variables and methods
4206DCL19-CPP. Initialize automatic local variables on declaration
4207DCL19-CPP. Initialize automatic local variables on declaration
4213DCL13-CPP. Declare function parameters that are pointers to values not changed by the function as const
4218DCL19-CPP. Initialize automatic local variables on declaration
4219DCL19-CPP. Initialize automatic local variables on declaration
424MEM02-CPP. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
4260OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4261OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4265DCL19-CPP. Initialize automatic local variables on declaration
4269DCL19-CPP. Initialize automatic local variables on declaration
4270DCL19-CPP. Initialize automatic local variables on declaration
4271DCL19-CPP. Initialize automatic local variables on declaration
4272DCL19-CPP. Initialize automatic local variables on declaration
4273OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4274OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4275OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4276OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4277OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4278OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4279OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4280OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4281OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4282OOP50-CPP. Do not invoke virtual functions from constructors or destructors
4283DCL13-CPP. Declare function parameters that are pointers to values not changed by the function as const
4400DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4400EXP07-CPP. Do not diminish the benefits of constants by assuming their values in expressions
4401DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4401EXP07-CPP. Do not diminish the benefits of constants by assuming their values in expressions
4402DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4403DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4404DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4405DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4405EXP07-CPP. Do not diminish the benefits of constants by assuming their values in expressions
4406DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4408DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4409DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4414DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4415DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic
4610MSC01-CPP. Strive for logical completeness
4611MSC01-CPP. Strive for logical completeness
4625OOP08-CPP. Do not return references to private data
4626OOP08-CPP. Do not return references to private data
4627OOP08-CPP. Do not return references to private data
4628OOP08-CPP. Do not return references to private data
4636ERR50-CPP. Do not call std::terminate(), std::abort(), or std::_Exit()
4637ERR50-CPP. Do not call std::terminate(), std::abort(), or std::_Exit()
Secondary AnalysisINT06-CPP. Use strtol() or a related function to convert a string token to an integer4647MSC35-CPP. Do not use goto statement to take control inside the try and catch blocks
Secondary AnalysisPRE04-CPP. Do not reuse a standard header file name
Secondary AnalysisanalysisPRE31ERR52-CPP. Avoid side-effects in arguments to unsafe macrosDo not use setjmp() or longjmp()
Secondary analysisSecondary AnalysisDCL09-CPP. Declare functions that return errno with a return type of errno_t
Secondary AnalysisINT06-CPP. Use strtol() or a related function to convert a string token to an integer
Secondary AnalysisMEM00-CPP. Don't use auto_ptr where copy semantics might be expected
Warncall -wc randMSC50-CPP. Do not use std::rand() for generating pseudorandom numbersSecondary AnalysisERR34-CPP. Do not use longjmp
warncallPRE09-CPP. Do not replace secure functions with less secure functions