libxl: Compile with -Wformat-nonliteral
PATCH 1/1 libxl: Compile with -Wformat-nonliteral
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1323786705 0
# Node ID 1a48c8fbcae917bed86f861c26bcca8638905efe # Parent f28c55c5a90aacef252bd7100aa4ceb4c2077f0b
libxl: Compile with -Wformat-nonliteral.
At least one compiler (some Ubuntu version) uses this by default and it seems like a good idea anyway and the fixup required is trivial.
One hunk is from a patch by Ian Jackson.
Signed-off-by Ian Jackson <[email protected]>
Signed-off-by Ian Campbell <[email protected]>
Reported-by Adda Rathbone <[email protected]>
Tested-by Adda Rathbone <[email protected]>
Tested-by Andrew Pounce <[email protected]>
tools/libxl/Makefile +1 -1
@@ -12,7 +12,7 @@ XLUMAJOR = 1.0 XLUMINOR = 0 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ - -Wno-declaration-after-statement + -Wno-declaration-after-statement -Wformat-nonliteral CFLAGS += -I. -fPIC ifeq ($(CONFIG_Linux),y)
tools/libxl/libxl_create.c +2 -2
@@ -459,8 +459,8 @@ static int store_libxl_entry(libxl__gc * path =libxl__xs_libxl_path (gc, domid); path =libxl__sprintf (gc,"%s/dm-version" , path); -return libxl__xs_write (gc,XBT_NULL , path,"%s" ,libxl__strdup (gc, -libxl_device_model_version_to_string (dm_info->device_model_version))); +return libxl__xs_write (gc,XBT_NULL , path,"%s" , +libxl_device_model_version_to_string (dm_info->device_model_version)); } static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
tools/libxl/libxl_device.c +1 -1
@@ -515,7 +515,7 @@ int libxl__devices_destroy(libxl__gc *gcfor (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,"%s" , path)); + path =libxl__xs_read (gc,XBT_NULL , path);if (path &&libxl__parse_backend_path (gc, path, &dev) ==0 ) { dev.domid = domid; dev.kind = kind;
Ian Campbell writes ("[Xen-devel] [PATCH] libxl: Compile with -Wformat-nonliteral"):
Quoted 5 lines
Signed-off-by Ian Jackson <[email protected]>Signed-off-by Ian Campbell <[email protected]>Reported-by Adda Rathbone <[email protected]>Tested-by Adda Rathbone <[email protected]>Tested-by Andrew Pounce <[email protected]>
Committed-by Ian Jackson <[email protected]>