Conflicting types for built in function

Posted by Robert Powell on Sun 06 Mar 2005 08:52 AM — 2 posts, 14,644 views.

Australia #0
Im getting this warning for the function logf, in a rom derivitive Ghost Mud 3.0.

in merc.h
void     logf             args((char *fmt, ...));
in comm.c
void logf (char *fmt, ...)
{
  char buf[2 * MSL];
  va_list args;
  va_start (args, fmt);
  vsprintf (buf, fmt, args);
  va_end (args);

  log_string (buf);
}

I dont realy understand what the warning means(am looking it
up now on the net) nor do i know how to go about fixing it.
Thanks all for your time and help, in advance.
Amended on Wed 23 Mar 2005 08:35 PM by Nick Gammon
USA #1
Logf is a builtin function for floating-point logarithms. The warning is telling you that your function has the same name but different types.

To fix it, you'll most likely have to give your function some other name, such as logprintf.