Date: 19 Jul 2001 03:55:41 +0200 From: Assar Westerlund <assar@FreeBSD.ORG> To: Sheldon Hearn <sheldonh@starjuice.net> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Weird <stdarg.h> problem in 4.3-STABLE Message-ID: <5lsnftvg0y.fsf@assaris.sics.se> In-Reply-To: Sheldon Hearn's message of "Wed, 18 Jul 2001 19:34:08 %2B0200" References: <11254.995477648@axl.seasidesoftware.co.za>
next in thread | previous in thread | raw e-mail | index | archive | help
Sheldon Hearn <sheldonh@starjuice.net> writes:
> static inline void
> xdaemonwarn(char *fmt, ...)
> {
> va_list ap;
>
> va_start(ap, fmt);
> if (!daemon_quiet)
> warn(fmt, ap);
> va_end(ap);
>
> return;
> }
>
> GCC gives "syntax error before 'void'". Fair enough.
As other people have been saying, you need to use `vwarn'. The
following code compiles fine for me with a 4.3-STABLE gcc.
/assar
#include <stdarg.h>
#include <err.h>
static int daemon_quiet;
static inline void
xdaemonwarn(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
if (!daemon_quiet)
vwarn(fmt, ap);
va_end(ap);
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5lsnftvg0y.fsf>
