An external object or function shall be declared once in one and only one file
This checker is deactivated in a default Polyspace® as You Code analysis. See Checkers Deactivated in Polyspace as You Code Default Analysis.
An external object or function shall be declared once in one and only one file.
If you declare an identifier in a header file, you can include the header file in any translation unit where the identifier is defined or used. In this way, you ensure consistency between:
The declaration and the definition.
The declarations in different translation units.
The rule enforces the practice of declaring external objects or functions in header files.
The rule checker checks only explicit extern declarations (tentative
definitions are ignored). The checker flags variables or functions declared
extern in a non-header file.
Polyspace Bug Finder™ and Polyspace Code Prover™ check this coding rule differently. The analyses can produce different results.
Object object_name has external declarations in multiple
files.
Function function_name has external declarations in multiple
files.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace Code Prover or Polyspace Code Prover Server™.
| Group: Declarations and Definitions |
| Category: Required |
| AGC Category: Advisory |