Skip to main content

IAR Embedded Workbench for RX 5.20

CERT-DCL40-C

In this section:
Synopsis

Do not create incompatible declarations of the same function or object.

Enabled by default

Yes

Severity/Certainty

Low/Low

lowlow.png
Full description

Two or more incompatible declarations of the same function or object must not appear in the same program because they result in undefined behavior. This check is identical to MISRAC2012-Rule-8.3.

This is a link analysis check.

Coding standards
CERT DCL40-C

Incompatible declarations of the same function or object

MISRA C:2012 Rule-8.3

(Required) All declarations of an object or function shall use the same names and type qualifiers

Code examples

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

extern int i;

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

extern short i;