From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH] xl: fix compiler warnings Date: Fri, 2 Dec 2011 15:42:07 +0100 Message-ID: <4ED8E3BF.6050509@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050605000401050307090709" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --------------050605000401050307090709 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi, either GCC 4.6.1 or Ubuntu add -Werror=format-security to the -Wall set, so libxl compilation breaks: libxl_create.c: In function 'store_libxl_entry': libxl_create.c:454:9: error: format not a string literal and no format arguments [-Werror=format-security] cc1: all warnings being treated as errors attached patch fixes this and another occurrence. Patch from: Uwe Dannowski Signed-off-by: Andre Przywara Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany --------------050605000401050307090709 Content-Type: text/x-patch; name="libxl_sprintf_security.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxl_sprintf_security.patch" Content-Description: libxl_sprintf_security.patch diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index ce6a55e..6486156 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -461,7 +461,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid, path = libxl__xs_libxl_path(gc, domid); path = libxl__sprintf(gc, "%s/dm-version", path); - return libxl__xs_write(gc, XBT_NULL, path, libxl__strdup(gc, + return libxl__xs_write(gc, XBT_NULL, path, "%s", libxl__strdup(gc, libxl_device_model_version_to_string(dm_info->device_model_version))); } diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index a53fb70..1db395c 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -516,7 +516,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force) for (j = 0; j < num_devs; j++) { path = libxl__sprintf(gc, "/local/domain/%d/device/%s/%s/backend", domid, kinds[i], devs[j]); - path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, path)); + path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s", path)); if (path && libxl__parse_backend_path(gc, path, &dev) == 0) { dev.domid = domid; dev.kind = kind; --------------050605000401050307090709 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050605000401050307090709--