Keil Logo

C51: ERROR C267 ('FUNCTION': REQUIRES ANSI-STYLE PROTOTYPE)


Information in this article applies to:

  • C51 Version 5 and Later

QUESTION

I've received the following error message while compiling my program:

Error C267: 'func_foo': requires ANSI-style prototype

What does this message mean?

ISSUE

If this error message appears by itself, it indicates that the function prototype for func_foo() has an empty parameter list, but the function definition of func_foo() includes parameters. Function prototypes must match function definitions.

Sometime this error also appears if the compiler cannot find the header file for a project. If so, resolve the other errors in the output window, to resolve this one.

RESOLUTION

Find the prototype and either remove it or update it so that its arguments match that of the definition. Function prototypes must proceed function references in the source file, otherwise the compiler may interpret a function call as a function prototype.

If the error is for a function pointer, or for C code to Assembly code, pay attention to the compiler syntax rules in the manual.

If the issue is difficult to resolve, PC-LINT can provide more details, see an example here.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, March 23, 2018


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.