[Spice-devel,xf86-video-qxl,08/13] spiceqxl_io_port: use attribute printf (fix warning)

Submitted by Alon Levy on April 9, 2012, 5:33 p.m.

Details

Message ID 1333992799-14302-9-git-send-email-alevy@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy April 9, 2012, 5:33 p.m.
---
 src/spiceqxl_io_port.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/spiceqxl_io_port.c b/src/spiceqxl_io_port.c
index ea02ac1..050e7b9 100644
--- a/src/spiceqxl_io_port.c
+++ b/src/spiceqxl_io_port.c
@@ -58,7 +58,7 @@ 
 
 static int spiceqxl_io_port_debug_level = -1;
 
-static void dprint(int _level, const char *_fmt, ...)
+static void __attribute__ ((format (printf, 2, 3))) dprint(int _level, const char *_fmt, ...)
 {
     if (spiceqxl_io_port_debug_level == -1) {
         if (getenv("XSPICE_IO_PORT_DEBUG_LEVEL")) {

Comments

ACK
do we want to hide these attributes in slightly more readable #define?

Christophe

On Mon, Apr 09, 2012 at 08:33:14PM +0300, Alon Levy wrote:
> ---
>  src/spiceqxl_io_port.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/spiceqxl_io_port.c b/src/spiceqxl_io_port.c
> index ea02ac1..050e7b9 100644
> --- a/src/spiceqxl_io_port.c
> +++ b/src/spiceqxl_io_port.c
> @@ -58,7 +58,7 @@
>  
>  static int spiceqxl_io_port_debug_level = -1;
>  
> -static void dprint(int _level, const char *_fmt, ...)
> +static void __attribute__ ((format (printf, 2, 3))) dprint(int _level, const char *_fmt, ...)
>  {
>      if (spiceqxl_io_port_debug_level == -1) {
>          if (getenv("XSPICE_IO_PORT_DEBUG_LEVEL")) {
> -- 
> 1.7.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Tue, Apr 10, 2012 at 12:26:23PM +0200, Christophe Fergeau wrote:
> ACK
> do we want to hide these attributes in slightly more readable #define?

I'll see if there are any other users, if so I'll do an additional
patch.

> 
> Christophe
> 
> On Mon, Apr 09, 2012 at 08:33:14PM +0300, Alon Levy wrote:
> > ---
> >  src/spiceqxl_io_port.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/spiceqxl_io_port.c b/src/spiceqxl_io_port.c
> > index ea02ac1..050e7b9 100644
> > --- a/src/spiceqxl_io_port.c
> > +++ b/src/spiceqxl_io_port.c
> > @@ -58,7 +58,7 @@
> >  
> >  static int spiceqxl_io_port_debug_level = -1;
> >  
> > -static void dprint(int _level, const char *_fmt, ...)
> > +static void __attribute__ ((format (printf, 2, 3))) dprint(int _level, const char *_fmt, ...)
> >  {
> >      if (spiceqxl_io_port_debug_level == -1) {
> >          if (getenv("XSPICE_IO_PORT_DEBUG_LEVEL")) {
> > -- 
> > 1.7.9.3
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel