Date: Wed, 18 Jul 2001 13:08:21 -0500 From: Alfred Perlstein <bright@sneakerz.org> To: Sheldon Hearn <sheldonh@starjuice.net> Cc: freebsd-hackers@FreeBSD.org Subject: Re: Weird <stdarg.h> problem in 4.3-STABLE Message-ID: <20010718130821.J28164@sneakerz.org> In-Reply-To: <11254.995477648@axl.seasidesoftware.co.za>; from sheldonh@starjuice.net on Wed, Jul 18, 2001 at 07:34:08PM %2B0200 References: <11254.995477648@axl.seasidesoftware.co.za>
index | next in thread | previous in thread | raw e-mail
* Sheldon Hearn <sheldonh@starjuice.net> [010718 12:33] wrote:
>
> Hi folks,
>
> I'm busy developing a libdaemon implementation and have come unstuck on
> a weird problem with functions using variable argument lists in FreeBSD
> 4.3-STABLE.
>
> What I really want is a static inline void function declared in a header
> file and included in various source files, looking something like this:
>
> 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.
>
> So obviously, this should be implemented as a macro. But GCC warns that
> ANSI C doesn't support variable arguments to macros. Fine.
I think you have a problem with inline actually. :)
-Alfred
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010718130821.J28164>
