AUTOSAR C++14 Rule A16-2-3
An include directive shall be added explicitly for every symbol used in a file
Since R2021b
Description
Rule Definition
An include directive shall be added explicitly for every symbol used in a file.
Rationale
To avoid a compilation failure, declare every symbol, macro, and data type before use and include their associated header files in the source file.
Polyspace Implementation
Polyspace® reports a violation when a source file contains a symbol, macro, or data type and the header file in which the symbol, macro, or data type is defined in is not included in the same source file.
Polyspace does not report a violation if the header file containing the required include directive shares a name with the source file.
Troubleshooting
If you expect a rule violation but Polyspace does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Preprocessing directives |
Category: Required, Non-automated |
Version History
Introduced in R2021b