From owner-freebsd-hackers Wed Jul 18 10:43:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.39]) by hub.freebsd.org (Postfix) with SMTP id E8E5237B408 for ; Wed, 18 Jul 2001 10:43:05 -0700 (PDT) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 1176 invoked by uid 1000); 18 Jul 2001 17:47:15 -0000 Date: Wed, 18 Jul 2001 20:47:15 +0300 From: Peter Pentchev To: Sheldon Hearn Cc: freebsd-hackers@FreeBSD.org Subject: Re: Weird problem in 4.3-STABLE Message-ID: <20010718204715.C635@ringworld.oblivion.bg> Mail-Followup-To: Sheldon Hearn , freebsd-hackers@FreeBSD.org References: <11254.995477648@axl.seasidesoftware.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <11254.995477648@axl.seasidesoftware.co.za>; from sheldonh@starjuice.net on Wed, Jul 18, 2001 at 07:34:08PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message