CertC-INTΒΆ
Integers
Nested Rules
Understand the data model used by your implementation(s) |
|
Use rsize_t or size_t for all integer values representing the size of an object |
|
Understand integer conversion rules |
|
Do not use input functions to convert character data if they cannot handle all possible inputs |
|
Use only explicitly signed or unsigned char type for numeric values |
|
Verify that all integer values are in range |
|
Ensure enumeration constants map to unique values |
|
Do not make assumptions about the type of a plain int bit-field when used in an expression |
|
Use bitwise operators only on unsigned operands |
|
Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types |
|
Define integer constants in an implementation-independent manner |
|
Ensure that unsigned integer operations do not wrap |
|
Ensure that integer conversions do not result in lost or misinterpreted data |
|
Ensure that operations on signed integers do not result in overflow |
|
Ensure that division and remainder operations do not result in divide-by-zero errors |
|
Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand |
|
Use correct integer precisions |
|
Converting a pointer to integer or integer to pointer |
Options
Setting an option for this rule means setting the default for all nested rules.
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
This rule has no individual options.