From: Pauli N. <su...@gm...> - 2009-07-24 19:18:07
|
On Tue, Jul 21, 2009 at 12:21 PM, Julien Cristau <jcr...@de...>wrote: > On Mon, Jul 20, 2009 at 19:17:01 +0300, Pauli Nieminen wrote: > > > >From b7e77b71d1f2d8ff6741e534911e09f10e3f3d4e Mon Sep 17 00:00:00 2001 > > From: Pauli Nieminen <su...@gm...> > > Date: Mon, 20 Jul 2009 14:39:57 +0300 > > Subject: [PATCH 01/15] libdrm: Add function attribute for debug > > functions to let gcc check parameter correctness. > > > > --- > > libdrm/xf86drm.c | 5 ++++- > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c > > index 26dd812..4214b91 100644 > > --- a/libdrm/xf86drm.c > > +++ b/libdrm/xf86drm.c > > @@ -107,13 +107,16 @@ void drmSetServerInfo(drmServerInfoPtr info) > > * \internal > > * This function is a wrapper around vfprintf(). > > */ > > +static int drmDebugPrint(const char *format, va_list ap) > > __attribute__((format(printf,1,0))); > > > why add a forward declaration instead of adding the attribute to the > function definition? also your patches are whitespace damaged. > That is limitation of gcc. attributes has to be given in declaration. At least that is what manual says . I didn't test. > > > static int drmDebugPrint(const char *format, va_list ap) > > { > > return vfprintf(stderr, format, ap); > > } > > > > -static int (*drm_debug_print)(const char *format, va_list ap) = > drmDebugPrint; > > +static int (*drm_debug_print)(const char *format, va_list ap) > > __attribute__((format(printf,1,0))) = drmDebugPrint; > > + > > +void drmMsg(const char *format, ...) > __attribute__((format(printf,1,2))); > > > > void > > drmMsg(const char *format, ...) > > Cheers, > Julien > Attached the patches to prevent the damage to them. Pauli |