CertCRecommendations-INTΒΆ

Integers

Nested Rules

CertC-INT00

Understand the data model used by your implementation(s)

CertC-INT01

Use size_t for all integer values representing the size of an object

CertC-INT02

Understand integer conversion rules

CertC-INT04

Enforce limits on integer values originating from tainted sources

CertC-INT05

Do not use input functions to convert character data if they cannot handle all possible inputs

CertC-INT07

Use only explicitly signed or unsigned char type for numeric values

CertC-INT08

Verify that all integer values are in range

CertC-INT09

Ensure enumeration constants map to unique values

CertC-INT10

Do not assume a positive remainder when using the % operator

CertC-INT12

Do not make assumptions about the type of a plain int bit-field when used in an expression

CertC-INT13

Use bitwise operators only on unsigned operands

CertC-INT14

Avoid performing bitwise and arithmetic operations on the same data

CertC-INT15

Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types

CertC-INT16

Do not make assumptions about representation of signed integers

CertC-INT17

Define integer constants in an implementation-independent manner

CertC-INT18

Evaluate integer expressions in a larger size before comparing or assigning to that size

Options