From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id EBE4F5A0265 for ; Thu, 13 Oct 2022 06:09:48 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Mnwyb3MRVz4x1D; Thu, 13 Oct 2022 15:09:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1665634183; bh=o3GV9RpFIgr9jnLSQgX96dDg7IqaCiD58S4XXmE6m5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fM3R+L82edw+F1CttVqYu/8puf6Olk5AlQ59q3igPkIGheztB5VeB8gTd2k0BvJvH u5x11TVVfCIdM5OLwtd7oWBtzjL64QzekImMbwpehJg1d3Qd03InEtwR8JHBVWxyFu I024e/sSeinj11haIa++Ej2NqbCatys704c0XMCI= Date: Thu, 13 Oct 2022 12:13:50 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] log.h: Avoid unnecessary GNU extension for token pasting Message-ID: References: <20221012154536.1650577-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OhYXgUG0HN0J4fDt" Content-Disposition: inline In-Reply-To: <20221012154536.1650577-1-sbrivio@redhat.com> Message-ID-Hash: ZS7X3EUA6QTLUP22FLAMCT2MLCRCROM7 X-Message-ID-Hash: ZS7X3EUA6QTLUP22FLAMCT2MLCRCROM7 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --OhYXgUG0HN0J4fDt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 12, 2022 at 05:45:36PM +0200, Stefano Brivio wrote: > clang says: >=20 > ./log.h:23:18: warning: token pasting of ',' and __VA_ARGS__ is a GNU e= xtension [-Wgnu-zero-variadic-macro-arguments] >=20 > ...but we don't actually need token pasting there. Actually, we kinda do. Without token pasting this would be incorrect if there were any calls to trace() with just a string and no further parameters. We could, however, avoid the need by making it simply trace(...), rather than trace(format, ...). > Signed-off-by: Stefano Brivio > --- > log.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/log.h b/log.h > index f92394c..5abbfc5 100644 > --- a/log.h > +++ b/log.h > @@ -20,7 +20,7 @@ void trace_init(int enable); > #define trace(format, ...) \ > do { \ > if (log_trace) \ > - debug(format, ##__VA_ARGS__); \ > + debug(format, __VA_ARGS__); \ > } while (0) > =20 > void __openlog(const char *ident, int option, int facility); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --OhYXgUG0HN0J4fDt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmNHZkcACgkQgypY4gEw YSIx2Q//c/V1YzGs8wqnO/9a8Psz6Augoi571WquYEnH6JmzFey0a/PsgKmdO6dj 4D7iWdMK6fl9XnOwm83MJSv0kfJLLSbl4beezv7uhS+pNPQ2IZQFy645T4AWBpQW bPqiWVJ02kXIjK4ZzANHfeMKjdPdNQ5Eo1yZEazuK/g3RN7n/1VgXopDXVcpL0Ee iJgy0jhtPZ2nkoJD9PfIXtsxINf5brDFNHibJXp+7vl/ZH6m7zDd8zwi2Z1GrDBV +d27dXU5jTrTZF8MtVkkc/TRMMYGA3VesQEwfS8tGnVY30RaOxmLJLxXsnY4jbgA 3nomSlR7nNzti2ablIwPNmwPtJPHTtmlKDigD4KFD+7DPjNek99vxGLFeMopZQmv q9HZjyONhBIz0dLFU7iq2vP6WPagQQfQ+30EOjYh1ElKYa8sGCFpYM8sHfBKlfev xH1GXYEJskngIO6H2VhvdINXI9aJFzkxGYqbLwSaARm0LXEXtH9V0k0ey5Rl91mq kjomfZUmbgUytme/05xkU99hx0pHpifex02dnJOZWlM80Lvg7CrsVFiGaPQ7HNwY YQj76pjdbGdv8yFQhiiB75hE6m78dbSTWmD9kTq6LC78GzCqt6YvG4M8Au7UCJI/ aCex1wviAFM1+i4WOsR91DtaNeCA0oralgwspXb5C/m1Vje5sIQ= =ZxNB -----END PGP SIGNATURE----- --OhYXgUG0HN0J4fDt--