Main Content
AUTOSAR C++14 Rule A3-3-1
Objects or functions with external linkage (including members of named namespaces) shall be declared in a header file
Description
Rule Definition
Objects or functions with external linkage (including members of named namespaces) shall be declared in a header file.
Rationale
If you declare a function or object in a header file, it is clear that the
function or object is meant to be accessed in multiple translation units. If you
intend to access the function or object from a single translation unit, declare it
static
or in an unnamed namespace.
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: Basic Concepts |
Category: Required, Automated |
Version History
Introduced in R2019a