Jim Meyering wrote:
I noticed sexpr_get takes a printf-style format,
yet it is declared with no printf attribute. Here's the fix:
2007-10-17 Jim Meyering <meyering(a)redhat.com>
* src/xend_internal.c (sexpr_get): Declare with gcc's printf attribute.
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.148
diff -u -p -r1.148 xend_internal.c
--- src/xend_internal.c 15 Oct 2007 21:38:56 -0000 1.148
+++ src/xend_internal.c 17 Oct 2007 08:29:26 -0000
@@ -692,6 +692,10 @@ xend_op(virConnectPtr xend, const char *
*/
static struct sexpr *
sexpr_get(virConnectPtr xend, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+static struct sexpr *
+sexpr_get(virConnectPtr xend, const char *fmt, ...)
{
char buffer[4096];
char path[1024];
I changed it to use the ATTRIBUTE_FORMAT macro (expands to nothing on
non-GCC), and committed it.
Rich.
--
Emerging Technologies, Red Hat -
http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903