[Libguestfs] [nbdkit PATCH 04/10] perl: Ignore -Wshadow warnings

Eric Blake eblake at redhat.com
Sun Sep 1 02:29:41 UTC 2019


perl.h requires that the user declare a static PerlInterpreter * named
'my_perl', but also shadows this declaration in functions declared
with the XS() macro.  As there's no way to avoid this issue, turn off
this warning here so we can fix -Wshadow warnings elsewhere.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 plugins/perl/perl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c
index 59b26788..b0886bb6 100644
--- a/plugins/perl/perl.c
+++ b/plugins/perl/perl.c
@@ -50,6 +50,9 @@

 #include "cleanup.h"

+/* Use of perl.h insists on shadowing my_perl during XS(). */
+#pragma GCC diagnostic ignored "-Wshadow"
+
 static PerlInterpreter *my_perl;
 static const char *script;

-- 
2.21.0




More information about the Libguestfs mailing list