From owner-freebsd-arch@FreeBSD.ORG Thu Feb 5 11:30:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D988F16A542 for ; Thu, 5 Feb 2004 11:30:29 -0800 (PST) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 02DAA43D53 for ; Thu, 5 Feb 2004 11:30:00 -0800 (PST) (envelope-from john@baldwin.cx) Received: (qmail 29617 invoked from network); 5 Feb 2004 19:28:48 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 5 Feb 2004 19:28:48 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i15JSXM4014155; Thu, 5 Feb 2004 14:28:42 -0500 (EST) (envelope-from john@baldwin.cx) From: John Baldwin To: Stefan Farfeleder , arch@freebsd.org Date: Thu, 5 Feb 2004 14:05:59 -0500 User-Agent: KMail/1.5.4 References: <20040205164639.GC602@wombat.fafoe.narf.at> In-Reply-To: <20040205164639.GC602@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402051405.59533.john@baldwin.cx> X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Re: C99 variadic macros X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 19:30:33 -0000 On Thursday 05 February 2004 11:46 am, Stefan Farfeleder wrote: > Hi, > > I went through the source tree and converted all occurrences of > GNU-style variadic macros to C99 compliant ones in !contrib code. > For macros that (ab)use string concatenation like > > #define foo(fmt, args...) printf("%s: " fmt "\n", __func__, ##args) > > three printf's must be used. As almost all variadic macros are used for > debugging, this shouldn't matter much. Two occurrences > (src/lib/libypclnt/ypclnt.h and src/sys/dev/ichsmb/ichsmb.c) remain > since they can't be converted easily and are already protected by > defined(__GNUC__). > > http://www.ten15.org/~stefanf/FreeBSD/vamacro.diff C99 macros don't work when args is 0. I.e., if I did: foo("test"); The C99 _VA_ARGS_ think doesn't delete the , whereas the GCC way does. -- John Baldwin <>< http://www.baldwin.cx/~john/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org