CertCRecommendations-EXPΒΆ

Expressions

Nested Rules

CertC-EXP00

Use parentheses for precedence of operation

CertC-EXP02

Be aware of the short-circuit behavior of the logical AND and OR operators

CertC-EXP03

Do not assume the size of a structure is the sum of the sizes of its members

CertC-EXP05

Do not cast away a const qualification

CertC-EXP07

Do not diminish the benefits of constants by assuming their values in expressions

CertC-EXP08

Ensure pointer arithmetic is used correctly

CertC-EXP09

Use sizeof to determine the size of a type or variable

CertC-EXP10

Do not depend on the order of evaluation of subexpressions or the order in which side effects take place

CertC-EXP11

Do not make assumptions regarding the layout of structures with bit-fields

CertC-EXP12

Do not ignore values returned by functions

CertC-EXP13

Treat relational and equality operators as if they were nonassociative

CertC-EXP14

Beware of integer promotion when performing bitwise operations on integer types smaller than int

CertC-EXP15

Do not place a semicolon on the same line as an if, for, or while statement

CertC-EXP16

Do not compare function pointers to constant values

CertC-EXP19

Use braces for the body of an if, for, or while statement

CertC-EXP20

Perform explicit tests to determine success, true and false, and equality

Options