CertCRecommendations-DCL

Declarations and Initialization

Nested Rules

CertC-DCL00

Const-qualify immutable objects

CertC-DCL01

Do not reuse variable names in subscopes

CertC-DCL02

Use visually distinct identifiers

CertC-DCL03

Use a static assertion to test the value of a constant expression

CertC-DCL04

Do not declare more than one variable per declaration

CertC-DCL05

Use typedefs of non-pointer types only

CertC-DCL06

Use meaningful symbolic constants to represent literal values

CertC-DCL07

Include the appropriate type information in function declarators

CertC-DCL08

Properly encode relationships in constant definitions

CertC-DCL09

Declare functions that return errno with a return type of errno_t

CertC-DCL10

Maintain the contract between the writer and caller of variadic functions

CertC-DCL11

Understand the type issues associated with variadic functions

CertC-DCL12

Implement abstract data types using opaque types

CertC-DCL13

Declare function parameters that are pointers to values not changed by the function as const

CertC-DCL15

Declare file-scope objects or functions that do not need external linkage as static

CertC-DCL16

Use “L,” not “l,” to indicate a long value

CertC-DCL17

Beware of miscompiled volatile-qualified variables

CertC-DCL18

Do not begin integer constants with 0 when specifying a decimal value

CertC-DCL19

Minimize the scope of variables and functions

CertC-DCL20

Explicitly specify void when a function accepts no arguments

CertC-DCL21

Understand the storage of compound literals

CertC-DCL22

Use volatile for data that cannot be cached

CertC-DCL23

Guarantee that mutually visible identifiers are unique

Options