From: Thierry Reding <thierry.reding@gmail.com>
To: Keith Packard <keithp@keithp.com>
Cc: mesa-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))
Date: Mon, 13 Jan 2014 10:13:57 +0100 [thread overview]
Message-ID: <20140113091355.GB16296@ulmo.nvidia.com> (raw)
In-Reply-To: <1389551659-18559-1-git-send-email-keithp@keithp.com>
[-- Attachment #1.1: Type: text/plain, Size: 1222 bytes --]
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.
>
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
> xf86drm.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> 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 regions */
> typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */
>
> +#if (__GNUC__ >= 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
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-01-13 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-12 18:34 [PATCH] Mark debug_print with __attribute__ ((format(__printf__, 1, 0))) Keith Packard
2014-01-13 9:13 ` Thierry Reding [this message]
2014-01-13 14:19 ` Keith Packard
2014-01-13 18:03 ` Ian Romanick
2014-01-13 18:14 ` [Mesa-dev] " Keith Packard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140113091355.GB16296@ulmo.nvidia.com \
--to=thierry.reding@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=keithp@keithp.com \
--cc=mesa-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox