Skip to main content

IAR Embedded Workbench for RH850 3.20.x

FUNC-unprototyped-used

In this section:
Synopsis

Arguments are passed to functions without a valid prototype.

Enabled by default

Yes

Severity/Certainty

Low/Low

lowlow.png
Full description

Arguments are passed to functions without a valid prototype. This is permitted in C89, but it is unsafe because it bypasses all type checking.

Coding standards
CERT DCL20-C

Always specify void even if a function accepts no arguments

CERT DCL31-C

Declare identifiers before using them

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(77);
    func(77.0);
}

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

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