Declarations and Initialization (DCL)
- DCL00-C. Const-qualify immutable objects
- DCL01-C. Do not reuse variable names in subscopes
- DCL02-C. Use visually distinct identifiers
- DCL03-C. Use a static assertion to test the value of a constant expression
- DCL04-C. Do not declare more than one variable per declaration
- DCL05-C. Use typedefs of non-pointer types only
- DCL06-C. Use meaningful symbolic constants to represent literal values
- DCL07-C. Include the appropriate type information in function declarators
- DCL08-C. Properly encode relationships in constant definitions
- DCL09-C. Declare functions that return errno with a return type of errno_t
- DCL10-C. Maintain the contract between the writer and caller of variadic functions
- DCL11-C. Understand the type issues associated with variadic functions
- DCL12-C. Implement abstract data types using opaque types
- DCL13-C. Declare function parameters that are pointers to values not changed by the function as const
- DCL15-C. Declare file-scope objects or functions that do not need external linkage as static
- DCL16-C. Use "L," not "l," to indicate a long value
- DCL17-C. Beware of miscompiled volatile-qualified variables
- DCL18-C. Do not begin integer constants with 0 when specifying a decimal value
- DCL19-C. Minimize the scope of variables and functions
- DCL20-C. Explicitly specify void when a function accepts no arguments
- DCL21-C. Understand the storage of compound literals
- DCL22-C. Use volatile for data that cannot be cached
- DCL23-C. Guarantee that mutually visible identifiers are unique
Information for Editors
In order to have a new guideline automatically listed above be sure to label it dcl and recommendation .
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| DCL00-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL01-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL02-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL03-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL04-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL05-C | Low | Unlikely | Yes | No | P2 | L3 |
| DCL06-C | Low | Unlikely | Yes | No | P2 | L3 |
| DCL07-C | Low | Unlikely | Yes | No | P2 | L3 |
| DCL08-C | Low | Unlikely | No | No | P1 | L3 |
| DCL09-C | Low | Unlikely | No | Yes | P2 | L3 |
| DCL10-C | High | Probable | No | No | P6 | L2 |
| DCL11-C | High | Probable | Yes | No | P12 | L1 |
| DCL12-C | Low | Unlikely | No | No | P1 | L3 |
| DCL13-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL15-C | Low | Unlikely | No | No | P1 | L3 |
| DCL16-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL17-C | Medium | Probable | No | No | P4 | L3 |
| DCL18-C | Low | Unlikely | No | No | P1 | L3 |
| DCL19-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| DCL20-C | Medium | Probable | Yes | Yes | P12 | L1 |
| DCL21-C | Low | Unlikely | No | No | P1 | L3 |
| DCL22-C | Low | Probable | No | Yes | P4 | L3 |
| DCL23-C | Medium | Unlikely | Yes | Yes | P6 | L2 |


