This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Disable and document xop_name gcc warning seen in HP-UX.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 16 Jun 2014 18:52:37 +0000 (14:52 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 16 Jun 2014 23:22:06 +0000 (19:22 -0400)
op.c

diff --git a/op.c b/op.c
index 4e569dd..f321f20 100644 (file)
--- a/op.c
+++ b/op.c
@@ -11711,7 +11711,15 @@ Perl_custom_op_get_field(pTHX_ const OP *o, const xop_flags_enum field)
            if(flags & field) {
                switch(field) {
                case XOPe_xop_name:
+                    /* Some gcc releases emit a warning for this function:
+                     * op.c: In function 'Perl_custom_op_get_field':
+                     * op.c:...: warning: 'any.xop_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                     * This does seem to be a false warning: the xop,
+                     * including xop_name, does get initialized on all
+                     * execution paths. */
+                    GCC_DIAG_IGNORE(-Wmaybe-uninitialized);
                    any.xop_name = xop->xop_name;
+                    GCC_DIAG_RESTORE;
                    break;
                case XOPe_xop_desc:
                    any.xop_desc = xop->xop_desc;