This report documents the coverage of CERT conformance. Its notation is derived from MISRA, please refer for details of the following reports (GEP, GRP, GCS, etc.) to this standard.
This section targets to provide an overview of Guidelines Enforcement Plan (GEP).
This document will only focus on STMicroelectronics NFC RF Abstraction Layer (RFAL).
The project has been designed to comply with the standard ISO/IEC 9899:1999 ([C99]).
The project complies to [C99],
the variables length has been consequently set to a dedicated value (cf 'namelength' option in table above).
Repository/components:
This section targets to provide an overview of Guidelines Enforcement Plan (GEP).
This document will only focus on STMicroelectronics NFC RF Abstraction Layer (RFAL).
The project has been designed to comply with the standard ISO/IEC 9899:1999 ([C99]).
1. Tools version
Component | Version | Target | Options | certccm | 1.5.0 | C | rcma | 2.3.0 | C_CPP | qac | 9.9.0 | C |
|
---|
2. Configuration
This section targets to provide the main configuration options used for CERT compliance.The project complies to [C99],
the variables length has been consequently set to a dedicated value (cf 'namelength' option in table above).
Repository/components:
- MCU target:
- RFAL informations:
- Project repositories SHA1:
- RFAL-ST25R3916
- Path: rfal
- Version: v3.0.0
- common: bd63699
- nucleo: afd8cc1
- rfal: 5b33cb9
3. Assistance/Enforcement
Guideline | Category | Description | Assistance/Enforcement Sub Rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ARR02 | Recommendation | Explicitly specify array bounds, even if implicitly defined by an initializer |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR30 | Rule | Do not form or use out-of-bounds pointers or array subscripts |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR32 | Rule | Ensure size arguments for variable length arrays are in a valid range |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR36 | Rule | Do not subtract or compare two pointers that do not refer to the same array |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR37 | Rule | Do not add or subtract an integer to a pointer to a non-array object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR38 | Rule | Guarantee that library functions do not form invalid pointers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARR39 | Rule | Do not add or subtract a scaled integer to a pointer |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON30 | Rule | Clean up thread-specific storage |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON31 | Rule | Do not destroy a mutex while it is locked |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON32 | Rule | Prevent data races when accessing bit-fields from multiple threads |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON33 | Rule | Avoid race conditions when using library functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON34 | Rule | Declare objects shared between threads with appropriate storage durations |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON35 | Rule | Avoid deadlock by locking in a predefined order |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON36 | Rule | Wrap functions that can spuriously wake up in a loop |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON37 | Rule | Do not call signal() in a multithreaded program |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON38 | Rule | Preserve thread safety and liveness when using condition variables |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON39 | Rule | Do not join or detach a thread that was previously joined or detached |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON40 | Rule | Do not refer to an atomic variable twice in an expression |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON41 | Rule | Wrap functions that can fail spuriously in a loop |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CON43 | Rule | Do not allow data races in multithreaded code |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL00 | Recommendation | Const-qualify immutable objects |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL01 | Recommendation | Do not reuse variable names in subscopes |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL05 | Recommendation | Use typedefs of non-pointer types only |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL06 | Recommendation | Use meaningful symbolic constants to represent literal values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL07 | Recommendation | Include the appropriate type information in function declarators |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL10 | Recommendation | Maintain the contract between the writer and caller of variadic functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL11 | Recommendation | Understand the type issues associated with variadic functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL13 | Recommendation | Declare function parameters that are pointers to values not changed by the function as const |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL15 | Recommendation | Declare file-scope objects or functions that do not need external linkage as static |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL16 | Recommendation | Use 'L', not 'l', to indicate a long value |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL18 | Recommendation | Do not begin integer constants with 0 when specifying a decimal value |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL19 | Recommendation | Minimize the scope of variables and functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL20 | Recommendation | Explicitly specify void when a function accepts no arguments |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL21 | Recommendation | Understand the storage of compound literals |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL23 | Recommendation | Guarantee that mutually visible identifiers are unique |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL30 | Rule | Declare objects with appropriate storage durations |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL31 | Rule | Declare identifiers before using them |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL36 | Rule | Do not declare an identifier with conflicting linkage classifications |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL37 | Rule | Do not declare or define a reserved identifier |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL38 | Rule | Use the correct syntax when declaring a flexible array member |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL39 | Rule | Avoid information leakage when passing a structure across a trust boundary |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL40 | Rule | Do not create incompatible declarations of the same function or object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DCL41 | Rule | Do not declare variables inside a switch statement before the first case label |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV03 | Recommendation | Sanitize the environment when invoking external programs |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV30 | Rule | Do not modify the object referenced by the return value of certain functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV31 | Rule | Do not rely on an environment pointer following an operation that may invalidate it |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV32 | Rule | All exit handlers must return normally |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV33 | Rule | Do not call system() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV34 | Rule | Do not store pointers returned by certain functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ERR30 | Rule | Set errno to zero before calling a library function known to set errno, and check errno only after the function returns a value indicating failure |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ERR32 | Rule | Do not rely on indeterminate values of errno |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ERR33 | Rule | Detect and handle standard library errors |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ERR34 | Rule | Detect errors when converting a string to a number |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP00 | Recommendation | Use parentheses for precedence of operation |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP02 | Recommendation | Be aware of the short-circuit behavior of the logical AND and OR operators |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP03 | Recommendation | Do not assume the size of a structure is the sum of the sizes of its members |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP05 | Recommendation | Do not cast away a const qualification |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP07 | Recommendation | Do not diminish the benefits of constants by assuming their values in expressions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP08 | Recommendation | Ensure pointer arithmetic is used correctly |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP10 | Recommendation | Do not depend on the order of evaluation of subexpressions or the order in which side effects take place |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP11 | Recommendation | Do not make assumptions regarding the layout of structures with bit-fields |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP12 | Recommendation | Do not ignore values returned by functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP13 | Recommendation | Treat relational and equality operators as if they were nonassociative |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP15 | Recommendation | Do not place a semicolon on the same line as an if, for, or while statement |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP16 | Recommendation | Do not compare function pointers to constant values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP19 | Recommendation | Use braces for the body of an if, for, or while statement |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP20 | Recommendation | Perform explicit tests to determine success, true and false, and equality |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP30 | Rule | Do not depend on the order of evaluation for side effects |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP32 | Rule | Do not access a volatile object through a nonvolatile reference |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP33 | Rule | Do not read uninitialized memory |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP34 | Rule | Do not dereference null pointers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP35 | Rule | Do not modify objects with temporary lifetime |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP36 | Rule | Do not cast pointers into more strictly aligned pointer types |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP37 | Rule | Call functions with the correct number and type of arguments |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP39 | Rule | Do not access a variable through a pointer of an incompatible type |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP40 | Rule | Do not modify constant objects |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP42 | Rule | Do not compare padding data |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP43 | Rule | Avoid undefined behavior when using restrict-qualified pointers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP44 | Rule | Do not rely on side effects in operands to sizeof, _Alignof, or _Generic |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP45 | Rule | Do not perform assignments in selection statements |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP46 | Rule | Do not use a bitwise operator with a Boolean-like operand |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP47 | Rule | Do not call va_arg with an argument of the incorrect type |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO01 | Recommendation | Be careful using functions that use file names for identification |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO03 | Recommendation | Do not make assumptions about fopen() and file creation |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO06 | Recommendation | Create files with appropriate access permissions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO08 | Recommendation | Take care when calling remove() on an open file |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO10 | Recommendation | Take care when using the rename() function |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO21 | Recommendation | Do not create temporary files in shared directories |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO30 | Rule | Exclude user input from format strings |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO32 | Rule | Do not perform operations on devices that are only appropriate for files |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO34 | Rule | Distinguish between characters read from a file and EOF or WEOF |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO37 | Rule | Do not assume that fgets() or fgetws() returns a nonempty string when successful |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO38 | Rule | Do not copy a FILE object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO39 | Rule | Do not alternately input and output from a stream without an intervening flush or positioning call |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO40 | Rule | Reset strings on fgets() or fgetws() failure |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO41 | Rule | Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO42 | Rule | Close files when they are no longer needed |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO44 | Rule | Only use values for fsetpos() that are returned from fgetpos() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO45 | Rule | Avoid TOCTOU race conditions while accessing files |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO46 | Rule | Do not access a closed file |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FIO47 | Rule | Use valid format strings |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP02 | Recommendation | Avoid using floating-point numbers when precise computation is needed |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP06 | Recommendation | Convert integers to floating point for floating point operations |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP30 | Rule | Do not use floating-point variables as loop counters |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP32 | Rule | Prevent or detect domain and range errors in math functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP34 | Rule | Ensure that floating-point conversions are within range of the new type |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP36 | Rule | Preserve precision when converting integral values to floating-point type |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FLP37 | Rule | Do not use object representations to compare floating-point values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT02 | Recommendation | Understand integer conversion rules |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT04 | Recommendation | Enforce limits on integer values originating from tainted sources |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT05 | Recommendation | Do not use input functions to convert character data if they cannot handle all possible inputs |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT07 | Recommendation | Use only explicitly signed or unsigned char type for numeric values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT08 | Recommendation | Verify that all integer values are in range |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT09 | Recommendation | Ensure enumeration constants map to unique values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT10 | Recommendation | Do not assume a positive remainder when using the % operator |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT12 | Recommendation | Do not make assumptions about the type of a plain int bit-field when used in an expression |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT13 | Recommendation | Use bitwise operators only on unsigned operands |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT16 | Recommendation | Do not make assumptions about representation of signed integers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT18 | Recommendation | Evaluate integer expressions in a larger size before comparing or assigning to that size |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT30 | Rule | Ensure that unsigned integer operations do not wrap |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT31 | Rule | Ensure that integer conversions do not result in lost or misinterpreted data |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT32 | Rule | Ensure that operations on signed integers do not result in overflow |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT33 | Rule | Ensure that division and remainder operations do not result in divide-by-zero errors |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT34 | Rule | Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT35 | Rule | Use correct integer precisions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT36 | Rule | Converting a pointer to integer or integer to pointer |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM02 | Recommendation | Immediately cast the result of a memory allocation function call into a pointer to the allocated type |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM03 | Recommendation | Clear sensitive information stored in reusable resources |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM05 | Recommendation | Avoid large stack allocations |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM30 | Rule | Do not access freed memory |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM31 | Rule | Free dynamically allocated memory when no longer needed |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM33 | Rule | Allocate and copy structures containing a flexible array member dynamically |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM34 | Rule | Only free memory allocated dynamically |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM35 | Rule | Allocate sufficient memory for an object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEM36 | Rule | Do not modify the alignment of objects by calling realloc() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC01 | Recommendation | Strive for logical completeness |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC04 | Recommendation | Use comments consistently and in a readable fashion |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC07 | Recommendation | Detect and remove dead code |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC09 | Recommendation | Character encoding: Use subset of ASCII for safety |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC12 | Recommendation | Detect and remove code that has no effect or is never executed |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC13 | Recommendation | Detect and remove unused values |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC14 | Recommendation | Do not introduce unnecessary platform dependencies |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC15 | Recommendation | Do not depend on undefined behavior |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC17 | Recommendation | Finish every set of statements associated with a case label with a break statement |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC20 | Recommendation | Do not use a switch statement to transfer control into a complex block |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC30 | Rule | Do not use the rand() function for generating pseudorandom numbers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC32 | Rule | Properly seed pseudorandom number generators |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC33 | Rule | Do not pass invalid data to the asctime() function |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC37 | Rule | Ensure that control never reaches the end of a non-void function |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC38 | Rule | Do not treat a predefined identifier as an object if it might only be implemented as a macro |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC39 | Rule | Do not call va_arg() on a va_list that has an indeterminate value |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC40 | Rule | Do not violate constraints |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MSC41 | Rule | Never hard code sensitive information |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS30 | Rule_Optional | Use the readlink() function properly |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS33 | Rule_Optional | Do not use vfork() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS34 | Rule_Optional | Do not call putenv() with a pointer to an automatic variable as the argument |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS35 | Rule_Optional | Avoid race conditions while checking for the existence of a symbolic link |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS36 | Rule_Optional | Observe correct revocation order while relinquishing privileges |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS37 | Rule_Optional | Ensure that privilege relinquishment is successful |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS38 | Rule_Optional | Beware of race conditions when using fork and file descriptors |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS39 | Rule_Optional | Use the correct byte ordering when transferring data between systems |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS44 | Rule_Optional | Do not use signals to terminate threads |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS47 | Rule_Optional | Do not use threads that can be canceled asynchronously |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS48 | Rule_Optional | Do not unlock or destroy another POSIX thread's mutex |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS49 | Rule_Optional | When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS50 | Rule_Optional | Declare objects shared between POSIX threads with appropriate storage durations |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS51 | Rule_Optional | Avoid deadlock with POSIX threads by locking in predefined order |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS52 | Rule_Optional | Do not perform operations that can block while holding a POSIX lock |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS53 | Rule_Optional | Do not use more than one mutex for concurrent waiting operations on a condition variable |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POS54 | Rule_Optional | Detect and handle POSIX library errors |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE00 | Recommendation | Prefer inline or static functions to function-like macros |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE01 | Recommendation | Use parentheses within macros around parameter names |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE02 | Recommendation | Macro replacement lists should be parenthesized |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE03 | Recommendation | Prefer typedefs to defines for encoding non-pointer types |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE04 | Recommendation | Do not reuse a standard header file name |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE05 | Recommendation | Understand macro replacement when concatenating tokens or performing stringification |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE06 | Recommendation | Enclose header files in an inclusion guard |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE07 | Recommendation | Avoid using repeated question marks |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE08 | Recommendation | Guarantee that header file names are unique |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE09 | Recommendation | Do not replace secure functions with deprecated or obsolescent functions |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE10 | Recommendation | Wrap multi-statement macros in a do-while loop |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE11 | Recommendation | Do not conclude macro definitions with a semicolon |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE12 | Recommendation | Do not define unsafe macros |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE30 | Rule | Do not create a universal character name through concatenation |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE31 | Rule | Avoid side effects in arguments to unsafe macros |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PRE32 | Rule | Do not use preprocessor directives in invocations of function-like macros |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG00 | Recommendation | Mask signals handled by noninterruptible signal handlers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG01 | Recommendation | Understand implementation-specific details regarding signal handler persistence |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG30 | Rule | Call only asynchronous-safe functions within signal handlers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG31 | Rule | Do not access shared objects in signal handlers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG34 | Rule | Do not call signal() from within interruptible signal handlers |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SIG35 | Rule | Do not return from a computational exception signal handler |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR04 | Recommendation | Use plain char for characters in the basic character set |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR05 | Recommendation | Use pointers to const when referring to string literals |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR06 | Recommendation | Do not assume that strtok() leaves the parse string unchanged |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR07 | Recommendation | Use the bounds-checking interfaces for string manipulation |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR09 | Recommendation | Don't assume numeric values for expressions with type plain character |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR10 | Recommendation | Do not concatenate different type of string literals |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR11 | Recommendation | Do not specify the bound of a character array initialized with a string literal |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR30 | Rule | Do not attempt to modify string literals |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR31 | Rule | Guarantee that storage for strings has sufficient space for character data and the null terminator |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR32 | Rule | Do not pass a non-null-terminated character sequence to a library function that expects a string |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR34 | Rule | Cast characters to unsigned char before converting to larger integer sizes |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR37 | Rule | Arguments to character-handling functions must be representable as an unsigned char |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR38 | Rule | Do not confuse narrow and wide character strings and functions |
|
This section targets to provide an overview of Guidelines Recategorization Plan.
Guideline | Description | Category | Revised Category |
---|---|---|---|
ARR02 | Explicitly specify array bounds, even if implicitly defined by an initializer | Recommendation | Recommendation |
ARR30 | Do not form or use out-of-bounds pointers or array subscripts | Rule | Rule |
ARR32 | Ensure size arguments for variable length arrays are in a valid range | Rule | Rule |
ARR36 | Do not subtract or compare two pointers that do not refer to the same array | Rule | Rule |
ARR37 | Do not add or subtract an integer to a pointer to a non-array object | Rule | Rule |
ARR38 | Guarantee that library functions do not form invalid pointers | Rule | Rule |
ARR39 | Do not add or subtract a scaled integer to a pointer | Rule | Rule |
CON30 | Clean up thread-specific storage | Rule | Rule |
CON31 | Do not destroy a mutex while it is locked | Rule | Rule |
CON32 | Prevent data races when accessing bit-fields from multiple threads | Rule | Rule |
CON33 | Avoid race conditions when using library functions | Rule | Rule |
CON34 | Declare objects shared between threads with appropriate storage durations | Rule | Rule |
CON35 | Avoid deadlock by locking in a predefined order | Rule | Rule |
CON36 | Wrap functions that can spuriously wake up in a loop | Rule | Rule |
CON37 | Do not call signal() in a multithreaded program | Rule | Rule |
CON38 | Preserve thread safety and liveness when using condition variables | Rule | Rule |
CON39 | Do not join or detach a thread that was previously joined or detached | Rule | Rule |
CON40 | Do not refer to an atomic variable twice in an expression | Rule | Rule |
CON41 | Wrap functions that can fail spuriously in a loop | Rule | Rule |
CON43 | Do not allow data races in multithreaded code | Rule | Rule |
DCL00 | Const-qualify immutable objects | Recommendation | Recommendation |
DCL01 | Do not reuse variable names in subscopes | Recommendation | Recommendation |
DCL05 | Use typedefs of non-pointer types only | Recommendation | Disapplied |
DCL06 | Use meaningful symbolic constants to represent literal values | Recommendation | Recommendation |
DCL07 | Include the appropriate type information in function declarators | Recommendation | Recommendation |
DCL10 | Maintain the contract between the writer and caller of variadic functions | Recommendation | Recommendation |
DCL11 | Understand the type issues associated with variadic functions | Recommendation | Recommendation |
DCL13 | Declare function parameters that are pointers to values not changed by the function as const | Recommendation | Recommendation |
DCL15 | Declare file-scope objects or functions that do not need external linkage as static | Recommendation | Recommendation |
DCL16 | Use 'L', not 'l', to indicate a long value | Recommendation | Recommendation |
DCL18 | Do not begin integer constants with 0 when specifying a decimal value | Recommendation | Recommendation |
DCL19 | Minimize the scope of variables and functions | Recommendation | Recommendation |
DCL20 | Explicitly specify void when a function accepts no arguments | Recommendation | Recommendation |
DCL21 | Understand the storage of compound literals | Recommendation | Recommendation |
DCL23 | Guarantee that mutually visible identifiers are unique | Recommendation | Recommendation |
DCL30 | Declare objects with appropriate storage durations | Rule | Rule |
DCL31 | Declare identifiers before using them | Rule | Rule |
DCL36 | Do not declare an identifier with conflicting linkage classifications | Rule | Rule |
DCL37 | Do not declare or define a reserved identifier | Rule | Rule |
DCL38 | Use the correct syntax when declaring a flexible array member | Rule | Rule |
DCL39 | Avoid information leakage when passing a structure across a trust boundary | Rule | Rule |
DCL40 | Do not create incompatible declarations of the same function or object | Rule | Rule |
DCL41 | Do not declare variables inside a switch statement before the first case label | Rule | Rule |
ENV03 | Sanitize the environment when invoking external programs | Recommendation | Recommendation |
ENV30 | Do not modify the object referenced by the return value of certain functions | Rule | Rule |
ENV31 | Do not rely on an environment pointer following an operation that may invalidate it | Rule | Rule |
ENV32 | All exit handlers must return normally | Rule | Rule |
ENV33 | Do not call system() | Rule | Rule |
ENV34 | Do not store pointers returned by certain functions | Rule | Rule |
ERR30 | Set errno to zero before calling a library function known to set errno, and check errno only after the function returns a value indicating failure | Rule | Rule |
ERR32 | Do not rely on indeterminate values of errno | Rule | Rule |
ERR33 | Detect and handle standard library errors | Rule | Disapplied |
ERR34 | Detect errors when converting a string to a number | Rule | Rule |
EXP00 | Use parentheses for precedence of operation | Recommendation | Recommendation |
EXP02 | Be aware of the short-circuit behavior of the logical AND and OR operators | Recommendation | Recommendation |
EXP03 | Do not assume the size of a structure is the sum of the sizes of its members | Recommendation | Recommendation |
EXP05 | Do not cast away a const qualification | Recommendation | Recommendation |
EXP07 | Do not diminish the benefits of constants by assuming their values in expressions | Recommendation | Recommendation |
EXP08 | Ensure pointer arithmetic is used correctly | Recommendation | Recommendation |
EXP10 | Do not depend on the order of evaluation of subexpressions or the order in which side effects take place | Recommendation | Recommendation |
EXP11 | Do not make assumptions regarding the layout of structures with bit-fields | Recommendation | Recommendation |
EXP12 | Do not ignore values returned by functions | Recommendation | Disapplied |
EXP13 | Treat relational and equality operators as if they were nonassociative | Recommendation | Recommendation |
EXP15 | Do not place a semicolon on the same line as an if, for, or while statement | Recommendation | Disapplied |
EXP16 | Do not compare function pointers to constant values | Recommendation | Recommendation |
EXP19 | Use braces for the body of an if, for, or while statement | Recommendation | Recommendation |
EXP20 | Perform explicit tests to determine success, true and false, and equality | Recommendation | Recommendation |
EXP30 | Do not depend on the order of evaluation for side effects | Rule | Rule |
EXP32 | Do not access a volatile object through a nonvolatile reference | Rule | Rule |
EXP33 | Do not read uninitialized memory | Rule | Rule |
EXP34 | Do not dereference null pointers | Rule | Rule |
EXP35 | Do not modify objects with temporary lifetime | Rule | Rule |
EXP36 | Do not cast pointers into more strictly aligned pointer types | Rule | Rule |
EXP37 | Call functions with the correct number and type of arguments | Rule | Rule |
EXP39 | Do not access a variable through a pointer of an incompatible type | Rule | Rule |
EXP40 | Do not modify constant objects | Rule | Rule |
EXP42 | Do not compare padding data | Rule | Rule |
EXP43 | Avoid undefined behavior when using restrict-qualified pointers | Rule | Rule |
EXP44 | Do not rely on side effects in operands to sizeof, _Alignof, or _Generic | Rule | Rule |
EXP45 | Do not perform assignments in selection statements | Rule | Rule |
EXP46 | Do not use a bitwise operator with a Boolean-like operand | Rule | Rule |
EXP47 | Do not call va_arg with an argument of the incorrect type | Rule | Rule |
FIO01 | Be careful using functions that use file names for identification | Recommendation | Recommendation |
FIO03 | Do not make assumptions about fopen() and file creation | Recommendation | Recommendation |
FIO06 | Create files with appropriate access permissions | Recommendation | Recommendation |
FIO08 | Take care when calling remove() on an open file | Recommendation | Recommendation |
FIO10 | Take care when using the rename() function | Recommendation | Recommendation |
FIO21 | Do not create temporary files in shared directories | Recommendation | Recommendation |
FIO30 | Exclude user input from format strings | Rule | Rule |
FIO32 | Do not perform operations on devices that are only appropriate for files | Rule | Rule |
FIO34 | Distinguish between characters read from a file and EOF or WEOF | Rule | Rule |
FIO37 | Do not assume that fgets() or fgetws() returns a nonempty string when successful | Rule | Rule |
FIO38 | Do not copy a FILE object | Rule | Rule |
FIO39 | Do not alternately input and output from a stream without an intervening flush or positioning call | Rule | Rule |
FIO40 | Reset strings on fgets() or fgetws() failure | Rule | Rule |
FIO41 | Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects | Rule | Rule |
FIO42 | Close files when they are no longer needed | Rule | Rule |
FIO44 | Only use values for fsetpos() that are returned from fgetpos() | Rule | Rule |
FIO45 | Avoid TOCTOU race conditions while accessing files | Rule | Rule |
FIO46 | Do not access a closed file | Rule | Rule |
FIO47 | Use valid format strings | Rule | Rule |
FLP02 | Avoid using floating-point numbers when precise computation is needed | Recommendation | Recommendation |
FLP06 | Convert integers to floating point for floating point operations | Recommendation | Recommendation |
FLP30 | Do not use floating-point variables as loop counters | Rule | Rule |
FLP32 | Prevent or detect domain and range errors in math functions | Rule | Rule |
FLP34 | Ensure that floating-point conversions are within range of the new type | Rule | Rule |
FLP36 | Preserve precision when converting integral values to floating-point type | Rule | Rule |
FLP37 | Do not use object representations to compare floating-point values | Rule | Rule |
INT02 | Understand integer conversion rules | Recommendation | Recommendation |
INT04 | Enforce limits on integer values originating from tainted sources | Recommendation | Recommendation |
INT05 | Do not use input functions to convert character data if they cannot handle all possible inputs | Recommendation | Recommendation |
INT07 | Use only explicitly signed or unsigned char type for numeric values | Recommendation | Recommendation |
INT08 | Verify that all integer values are in range | Recommendation | Recommendation |
INT09 | Ensure enumeration constants map to unique values | Recommendation | Recommendation |
INT10 | Do not assume a positive remainder when using the % operator | Recommendation | Recommendation |
INT12 | Do not make assumptions about the type of a plain int bit-field when used in an expression | Recommendation | Recommendation |
INT13 | Use bitwise operators only on unsigned operands | Recommendation | Recommendation |
INT16 | Do not make assumptions about representation of signed integers | Recommendation | Recommendation |
INT18 | Evaluate integer expressions in a larger size before comparing or assigning to that size | Recommendation | Recommendation |
INT30 | Ensure that unsigned integer operations do not wrap | Rule | Rule |
INT31 | Ensure that integer conversions do not result in lost or misinterpreted data | Rule | Rule |
INT32 | Ensure that operations on signed integers do not result in overflow | Rule | Rule |
INT33 | Ensure that division and remainder operations do not result in divide-by-zero errors | Rule | Rule |
INT34 | Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand | Rule | Rule |
INT35 | Use correct integer precisions | Rule | Rule |
INT36 | Converting a pointer to integer or integer to pointer | Rule | Rule |
MEM02 | Immediately cast the result of a memory allocation function call into a pointer to the allocated type | Recommendation | Recommendation |
MEM03 | Clear sensitive information stored in reusable resources | Recommendation | Recommendation |
MEM05 | Avoid large stack allocations | Recommendation | Recommendation |
MEM30 | Do not access freed memory | Rule | Rule |
MEM31 | Free dynamically allocated memory when no longer needed | Rule | Rule |
MEM33 | Allocate and copy structures containing a flexible array member dynamically | Rule | Rule |
MEM34 | Only free memory allocated dynamically | Rule | Rule |
MEM35 | Allocate sufficient memory for an object | Rule | Rule |
MEM36 | Do not modify the alignment of objects by calling realloc() | Rule | Rule |
MSC01 | Strive for logical completeness | Recommendation | Recommendation |
MSC04 | Use comments consistently and in a readable fashion | Recommendation | Recommendation |
MSC07 | Detect and remove dead code | Recommendation | Recommendation |
MSC09 | Character encoding: Use subset of ASCII for safety | Recommendation | Recommendation |
MSC12 | Detect and remove code that has no effect or is never executed | Recommendation | Recommendation |
MSC13 | Detect and remove unused values | Recommendation | Recommendation |
MSC14 | Do not introduce unnecessary platform dependencies | Recommendation | Recommendation |
MSC15 | Do not depend on undefined behavior | Recommendation | Recommendation |
MSC17 | Finish every set of statements associated with a case label with a break statement | Recommendation | Recommendation |
MSC20 | Do not use a switch statement to transfer control into a complex block | Recommendation | Recommendation |
MSC30 | Do not use the rand() function for generating pseudorandom numbers | Rule | Rule |
MSC32 | Properly seed pseudorandom number generators | Rule | Rule |
MSC33 | Do not pass invalid data to the asctime() function | Rule | Rule |
MSC37 | Ensure that control never reaches the end of a non-void function | Rule | Rule |
MSC38 | Do not treat a predefined identifier as an object if it might only be implemented as a macro | Rule | Rule |
MSC39 | Do not call va_arg() on a va_list that has an indeterminate value | Rule | Rule |
MSC40 | Do not violate constraints | Rule | Rule |
MSC41 | Never hard code sensitive information | Rule | Rule |
POS30 | Use the readlink() function properly | Rule_Optional | Rule_Optional |
POS33 | Do not use vfork() | Rule_Optional | Rule_Optional |
POS34 | Do not call putenv() with a pointer to an automatic variable as the argument | Rule_Optional | Rule_Optional |
POS35 | Avoid race conditions while checking for the existence of a symbolic link | Rule_Optional | Rule_Optional |
POS36 | Observe correct revocation order while relinquishing privileges | Rule_Optional | Rule_Optional |
POS37 | Ensure that privilege relinquishment is successful | Rule_Optional | Rule_Optional |
POS38 | Beware of race conditions when using fork and file descriptors | Rule_Optional | Rule_Optional |
POS39 | Use the correct byte ordering when transferring data between systems | Rule_Optional | Rule_Optional |
POS44 | Do not use signals to terminate threads | Rule_Optional | Rule_Optional |
POS47 | Do not use threads that can be canceled asynchronously | Rule_Optional | Rule_Optional |
POS48 | Do not unlock or destroy another POSIX thread's mutex | Rule_Optional | Rule_Optional |
POS49 | When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed | Rule_Optional | Rule_Optional |
POS50 | Declare objects shared between POSIX threads with appropriate storage durations | Rule_Optional | Rule_Optional |
POS51 | Avoid deadlock with POSIX threads by locking in predefined order | Rule_Optional | Rule_Optional |
POS52 | Do not perform operations that can block while holding a POSIX lock | Rule_Optional | Rule_Optional |
POS53 | Do not use more than one mutex for concurrent waiting operations on a condition variable | Rule_Optional | Rule_Optional |
POS54 | Detect and handle POSIX library errors | Rule_Optional | Disapplied |
PRE00 | Prefer inline or static functions to function-like macros | Recommendation | Disapplied |
PRE01 | Use parentheses within macros around parameter names | Recommendation | Recommendation |
PRE02 | Macro replacement lists should be parenthesized | Recommendation | Recommendation |
PRE03 | Prefer typedefs to defines for encoding non-pointer types | Recommendation | Recommendation |
PRE04 | Do not reuse a standard header file name | Recommendation | Recommendation |
PRE05 | Understand macro replacement when concatenating tokens or performing stringification | Recommendation | Recommendation |
PRE06 | Enclose header files in an inclusion guard | Recommendation | Recommendation |
PRE07 | Avoid using repeated question marks | Recommendation | Recommendation |
PRE08 | Guarantee that header file names are unique | Recommendation | Disapplied |
PRE09 | Do not replace secure functions with deprecated or obsolescent functions | Recommendation | Recommendation |
PRE10 | Wrap multi-statement macros in a do-while loop | Recommendation | Recommendation |
PRE11 | Do not conclude macro definitions with a semicolon | Recommendation | Disapplied |
PRE12 | Do not define unsafe macros | Recommendation | Disapplied |
PRE30 | Do not create a universal character name through concatenation | Rule | Rule |
PRE31 | Avoid side effects in arguments to unsafe macros | Rule | Rule |
PRE32 | Do not use preprocessor directives in invocations of function-like macros | Rule | Rule |
SIG00 | Mask signals handled by noninterruptible signal handlers | Recommendation | Recommendation |
SIG01 | Understand implementation-specific details regarding signal handler persistence | Recommendation | Recommendation |
SIG30 | Call only asynchronous-safe functions within signal handlers | Rule | Rule |
SIG31 | Do not access shared objects in signal handlers | Rule | Rule |
SIG34 | Do not call signal() from within interruptible signal handlers | Rule | Rule |
SIG35 | Do not return from a computational exception signal handler | Rule | Rule |
STR04 | Use plain char for characters in the basic character set | Recommendation | Recommendation |
STR05 | Use pointers to const when referring to string literals | Recommendation | Recommendation |
STR06 | Do not assume that strtok() leaves the parse string unchanged | Recommendation | Recommendation |
STR07 | Use the bounds-checking interfaces for string manipulation | Recommendation | Recommendation |
STR09 | Don't assume numeric values for expressions with type plain character | Recommendation | Recommendation |
STR10 | Do not concatenate different type of string literals | Recommendation | Recommendation |
STR11 | Do not specify the bound of a character array initialized with a string literal | Recommendation | Recommendation |
STR30 | Do not attempt to modify string literals | Rule | Rule |
STR31 | Guarantee that storage for strings has sufficient space for character data and the null terminator | Rule | Rule |
STR32 | Do not pass a non-null-terminated character sequence to a library function that expects a string | Rule | Rule |
STR34 | Cast characters to unsigned char before converting to larger integer sizes | Rule | Rule |
STR37 | Arguments to character-handling functions must be representable as an unsigned char | Rule | Rule |
STR38 | Do not confuse narrow and wide character strings and functions | Rule | Rule |
This section targets to provide an overview of Guidelines Compliance Summary.
Guideline | Category | Description | Compliance | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ARR02 | Recommendation | Explicitly specify array bounds, even if implicitly defined by an initializer | Compliant | ||||||||||||||||||||
ARR30 | Rule | Do not form or use out-of-bounds pointers or array subscripts | Compliant | ||||||||||||||||||||
ARR32 | Rule | Ensure size arguments for variable length arrays are in a valid range | Compliant | ||||||||||||||||||||
ARR36 | Rule | Do not subtract or compare two pointers that do not refer to the same array | Compliant | ||||||||||||||||||||
ARR37 | Rule | Do not add or subtract an integer to a pointer to a non-array object | Compliant | ||||||||||||||||||||
ARR38 | Rule | Guarantee that library functions do not form invalid pointers | Compliant | ||||||||||||||||||||
ARR39 | Rule | Do not add or subtract a scaled integer to a pointer | Compliant | ||||||||||||||||||||
CON30 | Rule | Clean up thread-specific storage | Compliant | ||||||||||||||||||||
CON31 | Rule | Do not destroy a mutex while it is locked | Compliant | ||||||||||||||||||||
CON32 | Rule | Prevent data races when accessing bit-fields from multiple threads | Compliant | ||||||||||||||||||||
CON33 | Rule | Avoid race conditions when using library functions | Compliant | ||||||||||||||||||||
CON34 | Rule | Declare objects shared between threads with appropriate storage durations | Compliant | ||||||||||||||||||||
CON35 | Rule | Avoid deadlock by locking in a predefined order | Compliant | ||||||||||||||||||||
CON36 | Rule | Wrap functions that can spuriously wake up in a loop | Compliant | ||||||||||||||||||||
CON37 | Rule | Do not call signal() in a multithreaded program | Compliant | ||||||||||||||||||||
CON38 | Rule | Preserve thread safety and liveness when using condition variables | Compliant | ||||||||||||||||||||
CON39 | Rule | Do not join or detach a thread that was previously joined or detached | Compliant | ||||||||||||||||||||
CON40 | Rule | Do not refer to an atomic variable twice in an expression | Compliant | ||||||||||||||||||||
CON41 | Rule | Wrap functions that can fail spuriously in a loop | Compliant | ||||||||||||||||||||
CON43 | Rule | Do not allow data races in multithreaded code | Compliant | ||||||||||||||||||||
DCL00 | Recommendation | Const-qualify immutable objects | Compliant with deviations:
|
||||||||||||||||||||
DCL01 | Recommendation | Do not reuse variable names in subscopes | Compliant | ||||||||||||||||||||
DCL05 | Recommendation | Use typedefs of non-pointer types only | Disapplied | ||||||||||||||||||||
DCL06 | Recommendation | Use meaningful symbolic constants to represent literal values | Compliant with deviations:
|
||||||||||||||||||||
DCL07 | Recommendation | Include the appropriate type information in function declarators | Compliant with deviations:
|
||||||||||||||||||||
DCL10 | Recommendation | Maintain the contract between the writer and caller of variadic functions | Compliant | ||||||||||||||||||||
DCL11 | Recommendation | Understand the type issues associated with variadic functions | Compliant | ||||||||||||||||||||
DCL13 | Recommendation | Declare function parameters that are pointers to values not changed by the function as const | Compliant | ||||||||||||||||||||
DCL15 | Recommendation | Declare file-scope objects or functions that do not need external linkage as static | Compliant | ||||||||||||||||||||
DCL16 | Recommendation | Use 'L', not 'l', to indicate a long value | Compliant | ||||||||||||||||||||
DCL18 | Recommendation | Do not begin integer constants with 0 when specifying a decimal value | Compliant | ||||||||||||||||||||
DCL19 | Recommendation | Minimize the scope of variables and functions | Compliant with deviations:
|
||||||||||||||||||||
DCL20 | Recommendation | Explicitly specify void when a function accepts no arguments | Compliant | ||||||||||||||||||||
DCL21 | Recommendation | Understand the storage of compound literals | Compliant | ||||||||||||||||||||
DCL23 | Recommendation | Guarantee that mutually visible identifiers are unique | Compliant with deviations:
|
||||||||||||||||||||
DCL30 | Rule | Declare objects with appropriate storage durations | Compliant | ||||||||||||||||||||
DCL31 | Rule | Declare identifiers before using them | Compliant | ||||||||||||||||||||
DCL36 | Rule | Do not declare an identifier with conflicting linkage classifications | Compliant | ||||||||||||||||||||
DCL37 | Rule | Do not declare or define a reserved identifier | Compliant | ||||||||||||||||||||
DCL38 | Rule | Use the correct syntax when declaring a flexible array member | Compliant | ||||||||||||||||||||
DCL39 | Rule | Avoid information leakage when passing a structure across a trust boundary | Compliant | ||||||||||||||||||||
DCL40 | Rule | Do not create incompatible declarations of the same function or object | Compliant with deviations:
|
||||||||||||||||||||
DCL41 | Rule | Do not declare variables inside a switch statement before the first case label | Compliant | ||||||||||||||||||||
ENV03 | Recommendation | Sanitize the environment when invoking external programs | Compliant | ||||||||||||||||||||
ENV30 | Rule | Do not modify the object referenced by the return value of certain functions | Compliant | ||||||||||||||||||||
ENV31 | Rule | Do not rely on an environment pointer following an operation that may invalidate it | Compliant | ||||||||||||||||||||
ENV32 | Rule | All exit handlers must return normally | Compliant | ||||||||||||||||||||
ENV33 | Rule | Do not call system() | Compliant | ||||||||||||||||||||
ENV34 | Rule | Do not store pointers returned by certain functions | Compliant | ||||||||||||||||||||
ERR30 | Rule | Set errno to zero before calling a library function known to set errno, and check errno only after the function returns a value indicating failure | Compliant | ||||||||||||||||||||
ERR32 | Rule | Do not rely on indeterminate values of errno | Compliant | ||||||||||||||||||||
ERR33 | Rule | Detect and handle standard library errors | Disapplied | ||||||||||||||||||||
ERR34 | Rule | Detect errors when converting a string to a number | Compliant | ||||||||||||||||||||
EXP00 | Recommendation | Use parentheses for precedence of operation | Compliant | ||||||||||||||||||||
EXP02 | Recommendation | Be aware of the short-circuit behavior of the logical AND and OR operators | Compliant | ||||||||||||||||||||
EXP03 | Recommendation | Do not assume the size of a structure is the sum of the sizes of its members | Compliant | ||||||||||||||||||||
EXP05 | Recommendation | Do not cast away a const qualification | Compliant | ||||||||||||||||||||
EXP07 | Recommendation | Do not diminish the benefits of constants by assuming their values in expressions | Compliant with deviations:
|
||||||||||||||||||||
EXP08 | Recommendation | Ensure pointer arithmetic is used correctly | Compliant | ||||||||||||||||||||
EXP10 | Recommendation | Do not depend on the order of evaluation of subexpressions or the order in which side effects take place | Compliant | ||||||||||||||||||||
EXP11 | Recommendation | Do not make assumptions regarding the layout of structures with bit-fields | Compliant with deviations:
|
||||||||||||||||||||
EXP12 | Recommendation | Do not ignore values returned by functions | Disapplied | ||||||||||||||||||||
EXP13 | Recommendation | Treat relational and equality operators as if they were nonassociative | Compliant | ||||||||||||||||||||
EXP15 | Recommendation | Do not place a semicolon on the same line as an if, for, or while statement | Disapplied | ||||||||||||||||||||
EXP16 | Recommendation | Do not compare function pointers to constant values | Compliant | ||||||||||||||||||||
EXP19 | Recommendation | Use braces for the body of an if, for, or while statement | Compliant | ||||||||||||||||||||
EXP20 | Recommendation | Perform explicit tests to determine success, true and false, and equality | Compliant | ||||||||||||||||||||
EXP30 | Rule | Do not depend on the order of evaluation for side effects | Compliant | ||||||||||||||||||||
EXP32 | Rule | Do not access a volatile object through a nonvolatile reference | Compliant | ||||||||||||||||||||
EXP33 | Rule | Do not read uninitialized memory | Compliant | ||||||||||||||||||||
EXP34 | Rule | Do not dereference null pointers | Compliant | ||||||||||||||||||||
EXP35 | Rule | Do not modify objects with temporary lifetime | Compliant | ||||||||||||||||||||
EXP36 | Rule | Do not cast pointers into more strictly aligned pointer types | Compliant | ||||||||||||||||||||
EXP37 | Rule | Call functions with the correct number and type of arguments | Compliant | ||||||||||||||||||||
EXP39 | Rule | Do not access a variable through a pointer of an incompatible type | Compliant with deviations:
|
||||||||||||||||||||
EXP40 | Rule | Do not modify constant objects | Compliant | ||||||||||||||||||||
EXP42 | Rule | Do not compare padding data | Compliant | ||||||||||||||||||||
EXP43 | Rule | Avoid undefined behavior when using restrict-qualified pointers | Compliant | ||||||||||||||||||||
EXP44 | Rule | Do not rely on side effects in operands to sizeof, _Alignof, or _Generic | Compliant | ||||||||||||||||||||
EXP45 | Rule | Do not perform assignments in selection statements | Compliant with deviations:
|
||||||||||||||||||||
EXP46 | Rule | Do not use a bitwise operator with a Boolean-like operand | Compliant | ||||||||||||||||||||
EXP47 | Rule | Do not call va_arg with an argument of the incorrect type | Compliant | ||||||||||||||||||||
FIO01 | Recommendation | Be careful using functions that use file names for identification | Compliant | ||||||||||||||||||||
FIO03 | Recommendation | Do not make assumptions about fopen() and file creation | Compliant | ||||||||||||||||||||
FIO06 | Recommendation | Create files with appropriate access permissions | Compliant | ||||||||||||||||||||
FIO08 | Recommendation | Take care when calling remove() on an open file | Compliant | ||||||||||||||||||||
FIO10 | Recommendation | Take care when using the rename() function | Compliant | ||||||||||||||||||||
FIO21 | Recommendation | Do not create temporary files in shared directories | Compliant | ||||||||||||||||||||
FIO30 | Rule | Exclude user input from format strings | Compliant | ||||||||||||||||||||
FIO32 | Rule | Do not perform operations on devices that are only appropriate for files | Compliant | ||||||||||||||||||||
FIO34 | Rule | Distinguish between characters read from a file and EOF or WEOF | Compliant | ||||||||||||||||||||
FIO37 | Rule | Do not assume that fgets() or fgetws() returns a nonempty string when successful | Compliant | ||||||||||||||||||||
FIO38 | Rule | Do not copy a FILE object | Compliant | ||||||||||||||||||||
FIO39 | Rule | Do not alternately input and output from a stream without an intervening flush or positioning call | Compliant | ||||||||||||||||||||
FIO40 | Rule | Reset strings on fgets() or fgetws() failure | Compliant | ||||||||||||||||||||
FIO41 | Rule | Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects | Compliant | ||||||||||||||||||||
FIO42 | Rule | Close files when they are no longer needed | Compliant | ||||||||||||||||||||
FIO44 | Rule | Only use values for fsetpos() that are returned from fgetpos() | Compliant | ||||||||||||||||||||
FIO45 | Rule | Avoid TOCTOU race conditions while accessing files | Compliant | ||||||||||||||||||||
FIO46 | Rule | Do not access a closed file | Compliant | ||||||||||||||||||||
FIO47 | Rule | Use valid format strings | Compliant | ||||||||||||||||||||
FLP02 | Recommendation | Avoid using floating-point numbers when precise computation is needed | Compliant | ||||||||||||||||||||
FLP06 | Recommendation | Convert integers to floating point for floating point operations | Compliant | ||||||||||||||||||||
FLP30 | Rule | Do not use floating-point variables as loop counters | Compliant | ||||||||||||||||||||
FLP32 | Rule | Prevent or detect domain and range errors in math functions | Compliant | ||||||||||||||||||||
FLP34 | Rule | Ensure that floating-point conversions are within range of the new type | Compliant | ||||||||||||||||||||
FLP36 | Rule | Preserve precision when converting integral values to floating-point type | Compliant | ||||||||||||||||||||
FLP37 | Rule | Do not use object representations to compare floating-point values | Compliant | ||||||||||||||||||||
INT02 | Recommendation | Understand integer conversion rules | Compliant with deviations:
|
||||||||||||||||||||
INT04 | Recommendation | Enforce limits on integer values originating from tainted sources | Compliant | ||||||||||||||||||||
INT05 | Recommendation | Do not use input functions to convert character data if they cannot handle all possible inputs | Compliant | ||||||||||||||||||||
INT07 | Recommendation | Use only explicitly signed or unsigned char type for numeric values | Compliant | ||||||||||||||||||||
INT08 | Recommendation | Verify that all integer values are in range | Compliant | ||||||||||||||||||||
INT09 | Recommendation | Ensure enumeration constants map to unique values | Compliant | ||||||||||||||||||||
INT10 | Recommendation | Do not assume a positive remainder when using the % operator | Compliant | ||||||||||||||||||||
INT12 | Recommendation | Do not make assumptions about the type of a plain int bit-field when used in an expression | Compliant | ||||||||||||||||||||
INT13 | Recommendation | Use bitwise operators only on unsigned operands | Compliant with deviations:
|
||||||||||||||||||||
INT16 | Recommendation | Do not make assumptions about representation of signed integers | Compliant | ||||||||||||||||||||
INT18 | Recommendation | Evaluate integer expressions in a larger size before comparing or assigning to that size | Compliant | ||||||||||||||||||||
INT30 | Rule | Ensure that unsigned integer operations do not wrap | Compliant with deviations:
|
||||||||||||||||||||
INT31 | Rule | Ensure that integer conversions do not result in lost or misinterpreted data | Compliant | ||||||||||||||||||||
INT32 | Rule | Ensure that operations on signed integers do not result in overflow | Compliant | ||||||||||||||||||||
INT33 | Rule | Ensure that division and remainder operations do not result in divide-by-zero errors | Compliant | ||||||||||||||||||||
INT34 | Rule | Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand | Compliant | ||||||||||||||||||||
INT35 | Rule | Use correct integer precisions | Compliant | ||||||||||||||||||||
INT36 | Rule | Converting a pointer to integer or integer to pointer | Compliant with deviations:
|
||||||||||||||||||||
MEM02 | Recommendation | Immediately cast the result of a memory allocation function call into a pointer to the allocated type | Compliant | ||||||||||||||||||||
MEM03 | Recommendation | Clear sensitive information stored in reusable resources | Compliant | ||||||||||||||||||||
MEM05 | Recommendation | Avoid large stack allocations | Compliant | ||||||||||||||||||||
MEM30 | Rule | Do not access freed memory | Compliant | ||||||||||||||||||||
MEM31 | Rule | Free dynamically allocated memory when no longer needed | Compliant | ||||||||||||||||||||
MEM33 | Rule | Allocate and copy structures containing a flexible array member dynamically | Compliant | ||||||||||||||||||||
MEM34 | Rule | Only free memory allocated dynamically | Compliant | ||||||||||||||||||||
MEM35 | Rule | Allocate sufficient memory for an object | Compliant | ||||||||||||||||||||
MEM36 | Rule | Do not modify the alignment of objects by calling realloc() | Compliant | ||||||||||||||||||||
MSC01 | Recommendation | Strive for logical completeness | Compliant with deviations:
|
||||||||||||||||||||
MSC04 | Recommendation | Use comments consistently and in a readable fashion | Compliant | ||||||||||||||||||||
MSC07 | Recommendation | Detect and remove dead code | Compliant with deviations:
|
||||||||||||||||||||
MSC09 | Recommendation | Character encoding: Use subset of ASCII for safety | Compliant | ||||||||||||||||||||
MSC12 | Recommendation | Detect and remove code that has no effect or is never executed | Compliant | ||||||||||||||||||||
MSC13 | Recommendation | Detect and remove unused values | Compliant with deviations:
|
||||||||||||||||||||
MSC14 | Recommendation | Do not introduce unnecessary platform dependencies | Compliant | ||||||||||||||||||||
MSC15 | Recommendation | Do not depend on undefined behavior | Compliant | ||||||||||||||||||||
MSC17 | Recommendation | Finish every set of statements associated with a case label with a break statement | Compliant | ||||||||||||||||||||
MSC20 | Recommendation | Do not use a switch statement to transfer control into a complex block | Compliant | ||||||||||||||||||||
MSC30 | Rule | Do not use the rand() function for generating pseudorandom numbers | Compliant | ||||||||||||||||||||
MSC32 | Rule | Properly seed pseudorandom number generators | Compliant | ||||||||||||||||||||
MSC33 | Rule | Do not pass invalid data to the asctime() function | Compliant | ||||||||||||||||||||
MSC37 | Rule | Ensure that control never reaches the end of a non-void function | Compliant | ||||||||||||||||||||
MSC38 | Rule | Do not treat a predefined identifier as an object if it might only be implemented as a macro | Compliant | ||||||||||||||||||||
MSC39 | Rule | Do not call va_arg() on a va_list that has an indeterminate value | Compliant | ||||||||||||||||||||
MSC40 | Rule | Do not violate constraints | Compliant | ||||||||||||||||||||
MSC41 | Rule | Never hard code sensitive information | Compliant | ||||||||||||||||||||
POS30 | Rule_Optional | Use the readlink() function properly | Compliant | ||||||||||||||||||||
POS33 | Rule_Optional | Do not use vfork() | Compliant | ||||||||||||||||||||
POS34 | Rule_Optional | Do not call putenv() with a pointer to an automatic variable as the argument | Compliant | ||||||||||||||||||||
POS35 | Rule_Optional | Avoid race conditions while checking for the existence of a symbolic link | Compliant | ||||||||||||||||||||
POS36 | Rule_Optional | Observe correct revocation order while relinquishing privileges | Compliant | ||||||||||||||||||||
POS37 | Rule_Optional | Ensure that privilege relinquishment is successful | Compliant | ||||||||||||||||||||
POS38 | Rule_Optional | Beware of race conditions when using fork and file descriptors | Compliant | ||||||||||||||||||||
POS39 | Rule_Optional | Use the correct byte ordering when transferring data between systems | Compliant | ||||||||||||||||||||
POS44 | Rule_Optional | Do not use signals to terminate threads | Compliant | ||||||||||||||||||||
POS47 | Rule_Optional | Do not use threads that can be canceled asynchronously | Compliant | ||||||||||||||||||||
POS48 | Rule_Optional | Do not unlock or destroy another POSIX thread's mutex | Compliant | ||||||||||||||||||||
POS49 | Rule_Optional | When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed | Compliant | ||||||||||||||||||||
POS50 | Rule_Optional | Declare objects shared between POSIX threads with appropriate storage durations | Compliant | ||||||||||||||||||||
POS51 | Rule_Optional | Avoid deadlock with POSIX threads by locking in predefined order | Compliant | ||||||||||||||||||||
POS52 | Rule_Optional | Do not perform operations that can block while holding a POSIX lock | Compliant | ||||||||||||||||||||
POS53 | Rule_Optional | Do not use more than one mutex for concurrent waiting operations on a condition variable | Compliant | ||||||||||||||||||||
POS54 | Rule_Optional | Detect and handle POSIX library errors | Disapplied | ||||||||||||||||||||
PRE00 | Recommendation | Prefer inline or static functions to function-like macros | Disapplied | ||||||||||||||||||||
PRE01 | Recommendation | Use parentheses within macros around parameter names | Compliant | ||||||||||||||||||||
PRE02 | Recommendation | Macro replacement lists should be parenthesized | Compliant | ||||||||||||||||||||
PRE03 | Recommendation | Prefer typedefs to defines for encoding non-pointer types | Compliant | ||||||||||||||||||||
PRE04 | Recommendation | Do not reuse a standard header file name | Compliant | ||||||||||||||||||||
PRE05 | Recommendation | Understand macro replacement when concatenating tokens or performing stringification | Compliant | ||||||||||||||||||||
PRE06 | Recommendation | Enclose header files in an inclusion guard | Compliant | ||||||||||||||||||||
PRE07 | Recommendation | Avoid using repeated question marks | Compliant | ||||||||||||||||||||
PRE08 | Recommendation | Guarantee that header file names are unique | Disapplied | ||||||||||||||||||||
PRE09 | Recommendation | Do not replace secure functions with deprecated or obsolescent functions | Compliant | ||||||||||||||||||||
PRE10 | Recommendation | Wrap multi-statement macros in a do-while loop | Compliant with deviations:
|
||||||||||||||||||||
PRE11 | Recommendation | Do not conclude macro definitions with a semicolon | Disapplied | ||||||||||||||||||||
PRE12 | Recommendation | Do not define unsafe macros | Disapplied | ||||||||||||||||||||
PRE30 | Rule | Do not create a universal character name through concatenation | Compliant | ||||||||||||||||||||
PRE31 | Rule | Avoid side effects in arguments to unsafe macros | Compliant | ||||||||||||||||||||
PRE32 | Rule | Do not use preprocessor directives in invocations of function-like macros | Compliant | ||||||||||||||||||||
SIG00 | Recommendation | Mask signals handled by noninterruptible signal handlers | Compliant | ||||||||||||||||||||
SIG01 | Recommendation | Understand implementation-specific details regarding signal handler persistence | Compliant | ||||||||||||||||||||
SIG30 | Rule | Call only asynchronous-safe functions within signal handlers | Compliant | ||||||||||||||||||||
SIG31 | Rule | Do not access shared objects in signal handlers | Compliant | ||||||||||||||||||||
SIG34 | Rule | Do not call signal() from within interruptible signal handlers | Compliant | ||||||||||||||||||||
SIG35 | Rule | Do not return from a computational exception signal handler | Compliant | ||||||||||||||||||||
STR04 | Recommendation | Use plain char for characters in the basic character set | Compliant | ||||||||||||||||||||
STR05 | Recommendation | Use pointers to const when referring to string literals | Compliant | ||||||||||||||||||||
STR06 | Recommendation | Do not assume that strtok() leaves the parse string unchanged | Compliant | ||||||||||||||||||||
STR07 | Recommendation | Use the bounds-checking interfaces for string manipulation | Compliant | ||||||||||||||||||||
STR09 | Recommendation | Don't assume numeric values for expressions with type plain character | Compliant | ||||||||||||||||||||
STR10 | Recommendation | Do not concatenate different type of string literals | Compliant | ||||||||||||||||||||
STR11 | Recommendation | Do not specify the bound of a character array initialized with a string literal | Compliant | ||||||||||||||||||||
STR30 | Rule | Do not attempt to modify string literals | Compliant | ||||||||||||||||||||
STR31 | Rule | Guarantee that storage for strings has sufficient space for character data and the null terminator | Compliant | ||||||||||||||||||||
STR32 | Rule | Do not pass a non-null-terminated character sequence to a library function that expects a string | Compliant | ||||||||||||||||||||
STR34 | Rule | Cast characters to unsigned char before converting to larger integer sizes | Compliant | ||||||||||||||||||||
STR37 | Rule | Arguments to character-handling functions must be representable as an unsigned char | Compliant | ||||||||||||||||||||
STR38 | Rule | Do not confuse narrow and wide character strings and functions | Compliant |
This section targets to provide an overview of Deviation Permits.
All the rules corresponding to the deviation permits are disabled inside Helix QAC and will not cause any violation or deviation in the Deviation records section below.
All the rules corresponding to the deviation permits are disabled inside Helix QAC and will not cause any violation or deviation in the Deviation records section below.
Guideline | Category | Description | Ratio | Sub Rules | Characteristics | Reason | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DCL00 | Recommendation | Const-qualify immutable objects | 2/5 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
DCL05 | Recommendation | Use typedefs of non-pointer types only | 1/1 (all) |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
DCL06 | Recommendation | Use meaningful symbolic constants to represent literal values | 2/6 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
DCL07 | Recommendation | Include the appropriate type information in function declarators | 1/6 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
DCL19 | Recommendation | Minimize the scope of variables and functions | 3/6 |
|
Maintainability / Modularity | RFAL Library contains functions which may be used by the user but are not called in the project used for checking compliance. |
||||||||||||||||||||
DCL23 | Recommendation | Guarantee that mutually visible identifiers are unique | 2/8 |
|
Maintainability / Analysability | Project is following C99 which defines 63 signficant characters. |
||||||||||||||||||||
DCL40 | Rule | Do not create incompatible declarations of the same function or object | 2/5 |
|
Maintainability / Analysability | Project is following C99 which defines 63 signficant characters. |
||||||||||||||||||||
ERR33 | Rule | Detect and handle standard library errors | 1/1 (all) |
|
Maintainability / Analysability | Treating the return codes of functions in all places without exception handling would make the code hard to read and maintain. Error checking has been reduced to the places where needed. |
||||||||||||||||||||
EXP07 | Recommendation | Do not diminish the benefits of constants by assuming their values in expressions | 2/6 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
EXP11 | Recommendation | Do not make assumptions regarding the layout of structures with bit-fields | 1/2 |
|
Other / AcceptedRecoBreach |
0751-See EXP39 |
||||||||||||||||||||
EXP12 | Recommendation | Do not ignore values returned by functions | 1/1 (all) |
|
Maintainability / Analysability | See ERR33. |
||||||||||||||||||||
EXP15 | Recommendation | Do not place a semicolon on the same line as an if, for, or while statement | 1/1 (all) |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
EXP39 | Rule | Do not access a variable through a pointer of an incompatible type | 1/3 |
|
Other / NonMatch | EXP39 states "Modifying a variable through a pointer of an incompatible type (other than unsigned char)". Therefore 0751 is disabled. |
||||||||||||||||||||
EXP45 | Rule | Do not perform assignments in selection statements | 1/4 |
|
Other / NonMatch | EXP45 is only targeting assignment inside expressions. 3416 is a considered an invalid mapping. |
||||||||||||||||||||
INT02 | Recommendation | Understand integer conversion rules | 7/119 |
|
Other / AcceptedRecoBreach | Code complies to MISRA restrictions for types and casts (Dir-1.1, Rule-1.1 ,10.1-10.8, 11.1-8) with documented exceptions. No further restrictions employed. |
||||||||||||||||||||
INT13 | Recommendation | Use bitwise operators only on unsigned operands | 1/5 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
INT30 | Rule | Ensure that unsigned integer operations do not wrap | 2/8 |
|
Maintainability / Testability | No apparent nor definite wraparound happening, checks for wraparound are omitted. |
||||||||||||||||||||
INT36 | Rule | Converting a pointer to integer or integer to pointer | 1/9 |
|
Maintainability / Modifiability | Using STM32 HAL already creates many violations. Also needed to do pointer arithmetic, calculating offsets inside a buffer. |
||||||||||||||||||||
MSC01 | Recommendation | Strive for logical completeness | 1/3 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
MSC07 | Recommendation | Detect and remove dead code | 9/28 |
|
Usability / User error protection | All the violations were checked and fixing the violation would deteriorate robustness: Removing checks which are unnecessary at the given position, removing trailing iterator increment, etc. Also suppressed for MISRA Rule-2.2 |
||||||||||||||||||||
MSC13 | Recommendation | Detect and remove unused values | 6/14 |
|
Usability / User error protection | All the violations were checked and fixing the violation would deteriorate robustness: Removing checks which are unnecessary at the given position, removing trailing iterator increment, etc. Also suppressed for MISRA Rule-2.2 |
||||||||||||||||||||
POS54 | Rule_Optional | Detect and handle POSIX library errors | 1/1 (all) |
|
Maintainability / Analysability | Only memcpy, memmove and memset are used which don't return errors. The more general 3200(already suppressed as part of ERR33) would only report other violations. |
||||||||||||||||||||
PRE00 | Recommendation | Prefer inline or static functions to function-like macros | 1/1 (all) |
|
Performance / Resource utilization | Suppressed due to code optimization and efficiency. Compare MISRA Dir-4.9. |
||||||||||||||||||||
PRE08 | Recommendation | Guarantee that header file names are unique | 1/1 (all) |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
PRE10 | Recommendation | Wrap multi-statement macros in a do-while loop | 1/2 |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
PRE11 | Recommendation | Do not conclude macro definitions with a semicolon | 1/1 (all) |
|
Other / AcceptedRecoBreach | |||||||||||||||||||||
PRE12 | Recommendation | Do not define unsafe macros | 1/1 (all) |
|
Other / AcceptedRecoBreach |
This section targets to provide an overview of Deviation Records.
Note: Qac messages can be mapped by more than one rule or group. In such case it will be counted several times.
File: rfal/include/rfal_utils.h
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
147 | 1 |
|
CERT C 9 - string.h from Cosmic only provides functions with low qualified parameters |
File: rfal/source/rfal_iso15693_2.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
524 | 1 |
|
CERT INT30 - Intentional underflow, part of the coding |
File: rfal/source/rfal_isoDep.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
1027 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
796 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2731 | 1 |
|
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication | ||
2794 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2279-2280 | 1 |
|
MISRA 11.3 - Intentional safe cast to avoiding buffer duplication | ||
1360 | 1 |
|
MISRA 16.3 - Intentional fall through |
File: rfal/source/rfal_nfc.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
1924 | 1 |
|
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication | ||
205 | 1 |
|
MISRA 2.1 - Unreachable code due to configuration option being set/unset | ||
2149 | 1 |
|
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication |
File: rfal/source/rfal_nfcDep.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
1681 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2689 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
1609 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2630 | 1 |
|
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication |
File: rfal/source/rfal_nfca.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
739 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
314 | 1 |
|
MISRA 16.3 - Intentional fall through |
File: rfal/source/rfal_t4t.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
136 | 1 |
|
MISRA 2.1 - Unreachable code due to configuration option being set/unset | ||
127 | 1 |
|
MISRA 2.1 - Unreachable code due to configuration option being set/unset |
File: rfal/source/st25r3916/rfal_analogConfigTbl.h
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
404-406 | 1 |
|
CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required |
File: rfal/source/st25r3916/rfal_dpoTbl.h
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
53-55 | 1 |
|
CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required |
File: rfal/source/st25r3916/rfal_rfst25r3916.c
Lines | Count | Suppressed Qacs | Comment | ||
---|---|---|---|---|---|
2059 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
3637 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2028 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2402 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2043 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2477 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2131 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2672 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2183 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2261 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
2565 | 1 |
|
MISRA 16.3 - Intentional fall through | ||
1055 | 1 |
|
MISRA 2.1 - Inconsistently marked as unreachable code |
File | Recommendation | Rule | Total |
---|---|---|---|
rfal/source/st25r3916/rfal_rfst25r3916.c | 12 | 0 | 12 |
rfal/source/st25r3916/rfal_dpoTbl.h | 1 | 0 | 1 |
rfal/source/rfal_t4t.c | 2 | 0 | 2 |
rfal/source/st25r3916/rfal_analogConfigTbl.h | 1 | 0 | 1 |
rfal/source/rfal_nfcDep.c | 4 | 1 | 5 |
rfal/source/rfal_nfca.c | 2 | 0 | 2 |
rfal/source/rfal_isoDep.c | 6 | 2 | 8 |
rfal/source/rfal_iso15693_2.c | 1 | 1 | 2 |
rfal/source/rfal_nfc.c | 3 | 2 | 5 |
rfal/include/rfal_utils.h | 1 | 0 | 1 |
Total | 33 | 6 | 39 |
Note: Qac messages can be mapped by more than one rule or group. In such case it will be counted several times.
There are no duplicated suppressions.
File: common/firmware/STM/utils/Inc/utils.h
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
79 |
|
MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters | ||
81 |
|
MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters |
File: rfal/include/rfal_utils.h
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
148 |
|
MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters | ||
150 |
|
MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters |
File: rfal/source/rfal_isoDep.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
2564 |
|
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created | ||
2557 |
|
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created | ||
2185 |
|
MISRA 10.5 - Layout of enum rfalIsoDepFSxI is guaranteed whithin 4bit range | ||
2653 |
|
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created | ||
2640 |
|
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created | ||
416 |
|
MISRA 19.2 - Members of the union will not be used concurrently, only one frame at a time | ||
1400 |
|
MISRA 10.5 - Layout of enum rfalBitRate and above masks guarantee no invalid enum values to be created |
File: rfal/source/rfal_nfc.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
77 |
|
MISRA 19.2 - Members of the union will not be used concurrently, only one interface at a time | ||
219 |
|
MISRA 2.1 - Unreachable code due to configuration option being set/unset |
File: rfal/source/rfal_nfcDep.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
1930 |
|
MISRA 10.5 - Layout of enum rfalBitRate and definition of rfalNfcDepBRS2DSI guarantee no invalid enum values to be created |
File: rfal/source/rfal_nfca.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
746 |
|
MISRA 10.5 - Guaranteed that no invalid enum values are created: see guard_eq_RFAL_NFCA_T2T, .... |
File: rfal/source/rfal_nfcb.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
545 |
|
MISRA 10.5 - Layout of rfalNfcbSlots and the limited loop guarantee that no invalid enum values are created. |
File: rfal/source/st25r3916/rfal_analogConfigTbl.h
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
717 |
|
MISRA 8.9 - Externally generated table included by the library | ||
405 | MISRA 8.9 - Externally generated table included by the library | |||
716 |
|
CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required | ||
405 |
|
MISRA 8.6 - Externally generated table included by the library | ||
717 | MISRA 8.6 - Externally generated table included by the library |
File: rfal/source/st25r3916/rfal_dpoTbl.h
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
65 |
|
CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required | ||
66 | MISRA 8.9 - Externally generated table included by the library | |||
66 |
|
MISRA 8.6 - Externally generated table included by the library | ||
54 | MISRA 8.9 - Externally generated table included by the library | |||
54 |
|
MISRA 8.6 - Externally generated table included by the library |
File: rfal/source/st25r3916/rfal_rfst25r3916.c
Line | Unused Qacs | Comment | ||
---|---|---|---|---|
3657 |
|
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff. | ||
3387 |
|
MISRA 19.2 - Allocating Union where members are of the same type, just different names. Thus no problem can occur. | ||
280 |
|
MISRA 19.2 - Both members are of the same type, just different names. Thus no problem can occur. | ||
1639 |
|
MISRA 4.9 - External function (sqrt()) requires double | ||
3890 |
|
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff. |
There are no continuous suppressions by file.
Active Diagnostics refers to diagnostics that are not suppressed (note: no suppressed diagnostics have been taken into account for the calculation of information in this document).
Nota: Calculation of Compliance Index
The Compliance Index is the percentage of groups which have no messages in them.
For each file it is calculated as follows:
( Ntotal - Nerror ) / Ntotal x 100
Ntotal is the total number of enforced rules (i.e. the number of rules that have at least one message mapped to it directly).
Nerror is the number of rules for which messages appear in that file.
The File Compliance Index is the mean of all the individual file compliances.
Files | Active Diagnostics | Violated Rules | Violation Count | Compliance Index |
---|---|---|---|---|
rfal/include/rfal_analogConfig.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_cd.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_chip.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_dpo.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_isoDep.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfc.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfcDep.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfca.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfcb.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfcf.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_nfcv.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_rf.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_st25tb.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_st25xv.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_t1t.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_t2t.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_t4t.h | 0 | 0 | 0 | 100.00 |
rfal/include/rfal_utils.h | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_analogConfig.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_cd.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_cdHb.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_crc.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_crc.h | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_dpo.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_iso15693_2.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_iso15693_2.h | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_isoDep.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfc.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfcDep.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfca.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfcb.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfcf.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_nfcv.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_st25tb.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_st25xv.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_t1t.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_t2t.c | 0 | 0 | 0 | 100.00 |
rfal/source/rfal_t4t.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/rfal_analogConfigTbl.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/rfal_dpoTbl.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/rfal_features.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/rfal_rfst25r3916.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_aat.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_aat.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_com.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_com.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_irq.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_irq.h | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_led.c | 0 | 0 | 0 | 100.00 |
rfal/source/st25r3916/st25r3916_led.h | 0 | 0 | 0 | 100.00 |
Total | 0 | 0 | 0 | 100.00 |
Nota: Calculation of Compliance Index
The Compliance Index is the percentage of groups which have no messages in them.
For each file it is calculated as follows:
( Ntotal - Nerror ) / Ntotal x 100
Ntotal is the total number of enforced rules (i.e. the number of rules that have at least one message mapped to it directly).
Nerror is the number of rules for which messages appear in that file.
The File Compliance Index is the mean of all the individual file compliances.