CertCRecommendations-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 |
|
Properly encode relationships in constant definitions |
|
Declare functions that return errno with a return type of errno_t |
|
Maintain the contract between the writer and caller of variadic functions |
|
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 |
|
Beware of miscompiled volatile-qualified variables |
|
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 |
|
Use volatile for data that cannot be cached |
|
Guarantee that mutually visible identifiers are unique |
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.