Old-style function declaration: warning #2027: Missing prototype for

Started by iZzz32, October 16, 2010, 07:39:35 PM

Previous topic - Next topic

iZzz32

Fresh Pelles C, console project, default settings. A code:
#include <stdio.h>
int xyzzy()
{
  return 0;
}

int main(void)
{
  xyzzy();
  return 0;
}

produces the following error message:

Building test.obj.
pellesc650-test\test.c(4): warning #2027: Missing prototype for 'xyzzy'.
*** Error code: 1 ***

Is it ok?

Stefan Pendl


#include <stdio.h>
int xyzzy(void,...)
{
 return 0;
}

int main(void)
{
 xyzzy(1);
 return 0;
}


The above should be OK, if you really need variable arguments.
---
Stefan

Proud member of the UltraDefrag Development Team

Pelle

func() In C++ this means the function takes no arguments, in C it means the function takes any number of arguments. The message could probably be clearer, but it was already available and is good enough...
/Pelle