DECL-implicit-int
In this section:
Synopsis
An object or function of the type int is declared or defined, but its type is not explicitly stated.
Enabled by default
No
Severity/Certainty
Medium/High

Full description
An object or function of the type int is declared or defined, but its type is not explicitly stated. The type of an object or function must be explicitly stated. This check is identical to MISRAC2004-8.2, 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;
}