Re: sexpr_get: add __printf__ attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

	* 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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]