From owner-freebsd-questions@FreeBSD.ORG Sun May 4 14:45:36 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AFBF1065672 for ; Sun, 4 May 2008 14:45:36 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr3.xs4all.nl (smtp-vbr3.xs4all.nl [194.109.24.23]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB708FC20 for ; Sun, 4 May 2008 14:45:36 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr3.xs4all.nl (8.13.8/8.13.8) with ESMTP id m44EjXqG037339; Sun, 4 May 2008 16:45:33 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id E5949B844; Sun, 4 May 2008 16:45:32 +0200 (CEST) Date: Sun, 4 May 2008 16:45:32 +0200 From: Roland Smith To: Patrick Clochesy Message-ID: <20080504144532.GA56965@slackbox.xs4all.nl> Mail-Followup-To: Patrick Clochesy , Peter Boosten , Unga , "freebsd-questions@freebsd.org" References: <336540.36159.qm@web57014.mail.re3.yahoo.com> <481DA10B.30903@boosten.org> <8FF3737F-1292-4A19-8A7D-789D8DD70CBE@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <8FF3737F-1292-4A19-8A7D-789D8DD70CBE@gmail.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: Unga , "freebsd-questions@freebsd.org" , Peter Boosten Subject: Re: Variable arg function question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2008 14:45:36 -0000 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 04, 2008 at 07:02:36AM -0700, Patrick Clochesy wrote: > What about using a macro (...) in front of the function to csll it which= =20 > passes __VARARGS__, NULL to ensure there is always a trailing NULL? I thi= nk=20 > this would at least work in GCC... Can' test on my phone though. That's a good idea. If one uses __VA_ARGS__ instead of __VARARGS__, it should work with any C99 compliant compiler, including gcc. The good thing about variadic macros in C99[1] is that you don't need a first argument. Roland [1: http://en.wikipedia.org/wiki/Variadic_macro] --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkgdzAwACgkQEnfvsMMhpyVeCACgoZJsIPd1rSAWHawZFjyDWkTO ZdsAoJr4U+57J4rPBvBoov5iqoTWTaYW =sVlN -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--