Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2004-8.2

In this section:
Synopsis

(Required) Whenever an object or function is declared or defined, its type shall be explicitly stated.

Enabled by default

Yes

Severity/Certainty

Medium/High

mediumhigh.png
Full description

An implicit int was found in a declaration. This check is identical to DECL-implicit-int, MISRAC2012-Rule-8.1.

Coding standards
CERT DCL31-C

Declare identifiers before using them

MISRA C:2004 8.2

(Required) Whenever an object or function is declared or defined, its type shall be explicitly stated.

MISRA C:2012 Rule-8.1

(Required) Types shall be explicitly specified

Code examples

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

void func(void)
{
    static y;
}

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

void func(void)
{
    int x;
}