From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] Mark debug_print with __attribute__ ((format(__printf__, 1, 0))) Date: Mon, 13 Jan 2014 10:13:57 +0100 Message-ID: <20140113091355.GB16296@ulmo.nvidia.com> References: <1389551659-18559-1-git-send-email-keithp@keithp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0151312414==" Return-path: In-Reply-To: <1389551659-18559-1-git-send-email-keithp@keithp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Keith Packard Cc: mesa-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0151312414== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 12, 2014 at 10:34:19AM -0800, Keith Packard wrote: > the drmServerInfo member, debug_print, takes a printf format string > and varargs list. Tell the compiler about it. >=20 > Signed-off-by: Keith Packard > --- > xf86drm.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/xf86drm.h b/xf86drm.h > index 1e763a3..5e170f8 100644 > --- a/xf86drm.h > +++ b/xf86drm.h > @@ -92,8 +92,14 @@ extern "C" { > typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regi= ons */ > typedef void *drmAddress, **drmAddressPtr; /**< For mapped regi= ons */ > =20 > +#if (__GNUC__ >=3D 3) > +#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) > +#else > +#define DRM_PRINTFLIKE(f, a) > +#endif > + > typedef struct _drmServerInfo { > - int (*debug_print)(const char *format, va_list ap); > + int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0); > int (*load_module)(const char *name); > void (*get_perms)(gid_t *, mode_t *); > } drmServerInfo, *drmServerInfoPtr; While at it, perhaps the drmMsg() and drmDebugPrint() functions should be similarily annotated as well? Thierry --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJS065TAAoJEN0jrNd/PrOh8eUP/R/Z8ioZHmGkmnW1Yp+LGTed k50/xKKg6RjRAiP4cgKlsWWCWuRarw+IRPgZAoS5pb8TndlbF6rNqg1SN2Az1sG+ /GO3cPqciY5WIcP/ciqUBDR83T4cNhjQGeLL4itgsKIawR5QaB9/zI+vhl61VaXP 1Q7OBZ2MhAezn4rb2hjh3teUx9Oe6lPmOhioBnBBqahVRkUYFpK3eo1PLRfx5nCy p4YtyHpiTSQjh6f2XeZ0cMYAeKNL7J9mXrXSyLiYgMeQUaYO8dIws5fUHVAEkY3Y yKGNM/hWjQpRCY5SgTDp/7BjB9tMKJd9eTsJHJ45avHNmERO4tWm0nz9v8iZjDWG mTLlW6qyIj0bTsq8TqMK9c+8oU7cG19wk81XrxfT5FfkgsNAvDJWslOwKZkhbdtE id0yGHL3Vg0bJxpsrZ64G56BNdTExui03IqzZf7qmJqrt5cbQqGg8XOYo4sv4gSc C1JQfNt0FIqBoek6Y6NJb0/rXpfLm6AjjR1IENdKN+74AN8hYVgL1TsQJBN7ZLvS KOavuJQWR2MMBMJ2rlD/dgqQVZcbX4j2wpXO3ShSBHq0pUURdQRhxRXGKALYEkNJ BK5CFVFABcHr7fkA/+aN7HBR9QTOMfAcqS2cm0xthXIm5jsu4unNuVkTPa9rZVF+ t20Fw6thC7H7YSLfUIOn =AY/C -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv-- --===============0151312414== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0151312414==--