Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC2012-Rule-1.5_b

In this section:
Synopsis

(Required) Obsolescent language features shall not be used.

Enabled by default

Yes

Severity/Certainty

Medium/High

mediumhigh.png
Full description

The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature.

Coding standards
MISRA C:2012 Rule-1.5

(Required) Obsolescent language features shall not be used.

Code examples

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

void func();	/* not a valid prototype in C */
void func2(void)
{
    func();
}

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

void func(void);
void func2(void)
{
    func();
}