CertC-DCL¶
Declarations and Initialization
Nested Rules
Const-qualify immutable objects |
|
Do not reuse variable names in subscopes |
|
Use visually distinct identifiers |
|
Use a static assertion to test the value of a constant expression |
|
Do not declare more than one variable per declaration |
|
Use typedefs of non-pointer types only |
|
Use meaningful symbolic constants to represent literal values |
|
Include the appropriate type information in function declarators |
|
Declare functions that return errno with a return type of errno_t |
|
Understand the type issues associated with variadic functions |
|
Implement abstract data types using opaque types |
|
Declare function parameters that are pointers to values not changed by the function as const |
|
Declare file-scope objects or functions that do not need external linkage as static |
|
Use “L,” not “l,” to indicate a long value |
|
Do not begin integer constants with 0 when specifying a decimal value |
|
Minimize the scope of variables and functions |
|
Explicitly specify void when a function accepts no arguments |
|
Understand the storage of compound literals |
|
Guarantee that mutually visible identifiers are unique |
|
Declare objects with appropriate storage durations |
|
Declare identifiers before using them |
|
Do not declare an identifier with conflicting linkage classifications |
|
Do not declare or define a reserved identifier |
|
Use the correct syntax when declaring a flexible array member |
|
Avoid information leakage when passing a structure across a trust boundary |
|
Do not create incompatible declarations of the same function or object |
|
Do not declare variables inside a switch statement before the first case label |
Options
Setting an option for this rule means setting the default for all nested rules.
This rule shares the following common options: 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.