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

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



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


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