On Wed, Jul 18, 2001 at 07:34:08PM +0200, Sheldon Hearn 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;
> }
Errrrrr. Snipped the rest, since this code snippet contains
an important mistake.
warn() does not take a va_list as an argument.
Try using vwarn(fmt, ap) instead, and your function looks fine.
G'luck,
Peter
--
I've heard that this sentence is a rumor.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message