[RFC 04/21] maint: Add helper macro VIR_USED

Shi Lei shi_lei at massclouds.com
Wed Jun 10 01:20:32 UTC 2020


The macro VIR_USED is used in generated parse/format functions to
avoid args-unused warnings.

Signed-off-by: Shi Lei <shi_lei at massclouds.com>
---
 src/internal.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/internal.h b/src/internal.h
index e181218..315f12d 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -502,3 +502,5 @@ enum {
 # define fprintf(fh, ...) g_fprintf(fh, __VA_ARGS__)
 
 #endif /* VIR_NO_GLIB_STDIO */
+
+#define VIR_USED(var) do { break; } while(var)
-- 
2.17.1





More information about the libvir-list mailing list