Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC++2023-6.5.1

In this section:
Synopsis

(Advisory) A function or object with external linkage should be introduced in a header file

Enabled by default

No

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Externally linked objects shall be declared in a header file. This check is identical to MISRAC++2008-3-3-1.

Coding standards
MISRA C++ 2008 3-3-1

(Required) Objects or functions with external linkage shall be declared in a header file.

Code examples

The following code example fails the check and will give a warning:

void example(){}

The following code example passes the check and will not give a warning about this issue:

namespace {
  
void example(){}

}