-Wpd: Error for Implicit Parameter Declaration

Group

MESSAGES

Scope

Function

Syntax
  -Wpd 
  
Arguments

None

Default

None

Defines

None

Pragmas

None

Description

This option prompts the Compiler to issue an ERROR message instead of a WARNING message when the Compiler encounters an implicit declaration. This occurs if the Compiler does not have a prototype for the called function.

This option helps prevent parameter-passing errors, which can only be detected at runtime. It requires prototyping each called function before use. Correct ANSI behavior assumes that parameters are correct for the stated call.

This option is the same as using -WmsgSe1801.

Example
  -Wpd

  
  main() {

  
    char a, b;

  
    myfunc(a, b); // <- Error here

  
  }

  
  myfunc(a, b, c)

  
    char a, b, c;

  
  {

  
    ...

  
  }

  
See also

Message C1801

-WmsgSe: Setting a Message to Error