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

[libvirt] [PATCH glib 1/2] Add printf/sentinel attribute annotations to helper functions



From: "Daniel P. Berrange" <berrange redhat com>

To allow the compiler to check args add G_GNUC_PRINTF and
G_GNUC_NULL_TERMINATED to libvirt-gconfig-helpers-private.h

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 libvirt-gconfig/libvirt-gconfig-helpers-private.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-helpers-private.h b/libvirt-gconfig/libvirt-gconfig-helpers-private.h
index 1384404..c0f6e4f 100644
--- a/libvirt-gconfig/libvirt-gconfig-helpers-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-helpers-private.h
@@ -31,17 +31,20 @@
 G_BEGIN_DECLS
 
 GError *gvir_config_error_new(GQuark domain, gint code,
-                              const gchar *format, ...);
+                              const gchar *format, ...)
+    G_GNUC_PRINTF(3, 4);
 void gvir_config_set_error(GError **err,
                            GQuark domain, gint code,
-                           const gchar *format, ...);
+                           const gchar *format, ...)
+    G_GNUC_PRINTF(4, 5);
 void gvir_config_set_error_literal(GError **err,
                                    GQuark domain, gint code,
                                    const gchar *message);
 void gvir_config_set_error_valist(GError **err,
                                   GQuark domain, gint code,
                                   const gchar *format,
-                                  va_list args);
+                                  va_list args)
+    G_GNUC_PRINTF(4, 0);
 xmlNodePtr gvir_config_xml_parse(const char *xml,
                                  const char *root_node,
                                  GError **err);
@@ -49,7 +52,8 @@ typedef gboolean (*GVirConfigXmlNodeIterator)(xmlNodePtr node, gpointer opaque);
 void gvir_config_xml_foreach_child(xmlNodePtr node,
                                    GVirConfigXmlNodeIterator iter_func,
                                    gpointer opaque);
-xmlNode * gvir_config_xml_get_element (xmlNode *node, ...);
+xmlNode * gvir_config_xml_get_element (xmlNode *node, ...)
+    G_GNUC_NULL_TERMINATED;
 const char * gvir_config_xml_get_child_element_content (xmlNode *node,
                                                         const char *child_name);
 const char *gvir_config_xml_get_attribute_content(xmlNodePtr node,
-- 
1.8.1.4


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