Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-8.1

In this section:
Synopsis

(Required) Types shall be explicitly specified.

Enabled by default

Yes

Severity/Certainty

Medium/High

mediumhigh.png
Full description

An object or function of the type int is declared or defined, but its type is not explicitly stated. This check is identical to DECL-implicit-int, MISRAC2004-8.2.

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;
}