Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-8.2_b

In this section:
Synopsis

(Required) Function types shall be in prototype form with named parameters.

Enabled by default

Yes

Severity/Certainty

Low/High

lowhigh.png
Full description

Function prototypes were found with unnamed parameters. This check is identical to MISRAC2004-16.3.

Coding standards
MISRA C:2004 16.3

(Required) Identifiers shall be given for all of the parameters in a function prototype declaration.

MISRA C:2012 Rule-8.2

(Required) Function types shall be in prototype form with named parameters

Code examples

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

char *strchr(const char *, int c);

void func(void)
{
    strchr("hello, world!\n", '!');
}

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

char *strchr(const char *s, int c);

void func(void)
{
    strchr("hello, world!\n", '!');
}