CertCRecommendations-EXPΒΆ
Expressions
Nested Rules
Use parentheses for precedence of operation |
|
Be aware of the short-circuit behavior of the logical AND and OR operators |
|
Do not assume the size of a structure is the sum of the sizes of its members |
|
Do not cast away a const qualification |
|
Do not diminish the benefits of constants by assuming their values in expressions |
|
Ensure pointer arithmetic is used correctly |
|
Use sizeof to determine the size of a type or variable |
|
Do not depend on the order of evaluation of subexpressions or the order in which side effects take place |
|
Do not make assumptions regarding the layout of structures with bit-fields |
|
Do not ignore values returned by functions |
|
Treat relational and equality operators as if they were nonassociative |
|
Beware of integer promotion when performing bitwise operations on integer types smaller than int |
|
Do not place a semicolon on the same line as an if, for, or while statement |
|
Do not compare function pointers to constant values |
|
Use braces for the body of an if, for, or while statement |
|
Perform explicit tests to determine success, true and false, and equality |
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.