[libvirt] [PATCH] util: Remove unnecessary ATTRIBUTE_NONNULL for virCommandAddArg[Pair]

John Ferlan jferlan at redhat.com
Tue Dec 18 15:39:20 UTC 2018

Commit 912c6b22 modified the virCommandAddArg and virCommandAddArgPair
to perform NULL argument checking; however, no corresponding change
to the prototypes was made to remove the ATTRIBUTE_NONNULL, so the
Coverity build failed. Adjust the prototypes accordingly.

Signed-off-by: John Ferlan <jferlan at redhat.com>
 It's a build breaker for Coverity or anything that enables STATIC_ANALYSIS
 so I'll push under that rule.

 src/util/vircommand.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index dbf5041890..100f7a06e0 100644
--- a/src/util/vircommand.h
+++ b/src/util/vircommand.h
@@ -123,7 +123,7 @@ void virCommandAddEnvPassAllowSUID(virCommandPtr cmd,
 void virCommandAddEnvPassCommon(virCommandPtr cmd);
 void virCommandAddArg(virCommandPtr cmd,
-                      const char *val) ATTRIBUTE_NONNULL(2);
+                      const char *val);
 void virCommandAddArgBuffer(virCommandPtr cmd,
                             virBufferPtr buf);
@@ -134,8 +134,7 @@ void virCommandAddArgFormat(virCommandPtr cmd,
 void virCommandAddArgPair(virCommandPtr cmd,
                           const char *name,
-                          const char *val)
+                          const char *val);
 void virCommandAddArgSet(virCommandPtr cmd,
                          const char *const*vals) ATTRIBUTE_NONNULL(2);

More information about the libvir-list mailing list