WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux-2.6.18: add __attribute__((format(printf... wh

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux-2.6.18: add __attribute__((format(printf... where appropriate
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 17 Jun 2011 16:23:11 +0100
Cc: joe@xxxxxxxxxxx
Delivery-date: Fri, 17 Jun 2011 08:24:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Joe Perches <joe@xxxxxxxxxxx>

Use the compiler to verify printf formats and arguments.

Fix fallout.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>

Make apply, slightly re-format, and fix more fallout (in blktap).

Signed-off-by: Jan Beulcih <jbeulich@xxxxxxxxxx>

--- a/drivers/xen/blkback/xenbus.c
+++ b/drivers/xen/blkback/xenbus.c
@@ -473,7 +473,7 @@ again:
 
        err = xenbus_switch_state(dev, XenbusStateConnected);
        if (err)
-               xenbus_dev_fatal(dev, err, "switching to Connected state",
+               xenbus_dev_fatal(dev, err, "%s: switching to Connected state",
                                 dev->nodename);
 
        return;
--- a/drivers/xen/blktap/xenbus.c
+++ b/drivers/xen/blktap/xenbus.c
@@ -426,7 +426,7 @@ again:
 
        err = xenbus_switch_state(dev, XenbusStateConnected);
        if (err)
-               xenbus_dev_fatal(dev, err, "switching to Connected state",
+               xenbus_dev_fatal(dev, err, "%s: switching to Connected state",
                                 dev->nodename);
 
        return;
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -276,7 +276,7 @@ enum xenbus_state xenbus_read_driver_sta
  * formatted message.
  */
 void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt,
-                     ...);
+                     ...) __attribute__((__format__(__printf__, 3, 4)));
 
 
 /***
@@ -285,7 +285,7 @@ void xenbus_dev_error(struct xenbus_devi
  * closedown of this driver and its peer.
  */
 void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
-                     ...);
+                     ...) __attribute__((__format__(__printf__, 3, 4)));
 
 int xenbus_dev_init(void);
 



Attachment: xen-xenbus-format-warnings.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux-2.6.18: add __attribute__((format(printf... where appropriate, Jan Beulich <=