CertCRecommendations-INTΒΆ
Integers
Nested Rules
Understand the data model used by your implementation(s) |
|
Use size_t for all integer values representing the size of an object |
|
Understand integer conversion rules |
|
Enforce limits on integer values originating from tainted sources |
|
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 assume a positive remainder when using the % operator |
|
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 |
|
Avoid performing bitwise and arithmetic operations on the same data |
|
Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types |
|
Do not make assumptions about representation of signed integers |
|
Define integer constants in an implementation-independent manner |
|
Evaluate integer expressions in a larger size before comparing or assigning to that size |
Options
Setting an option for this rule means setting the default for all nested rules.
This rule shares the following common options: confidence, 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.