Pelles C forum

Pelles C => Bug reports => Topic started by: iZzz32 on October 16, 2010, 07:39:35 PM

Title: Old-style function declaration: warning #2027: Missing prototype for
Post by: iZzz32 on October 16, 2010, 07:39:35 PM
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?
Title: Re: Variadic functions: warning #2027: Missing prototype for
Post by: Stefan Pendl on October 17, 2010, 01:11:46 AM

#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.
Title: Re: Old-style function declaration: warning #2027: Missing prototype for
Post by: Pelle on October 22, 2010, 08:31:24 PM
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...