This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate recently introduced compilation warnings.
authorJames E Keenan <jkeenan@cpan.org>
Mon, 9 Oct 2017 11:42:02 +0000 (13:42 +0200)
committerJames E Keenan <jkeenan@cpan.org>
Mon, 9 Oct 2017 11:42:02 +0000 (13:42 +0200)
Warnings like the following started to appear within last 24 hours while
running 'make' on Linux/gcc and FreeBSD-10.3/clang.

op.c: In function ‘Perl_newATTRSUB_x’:
op.c:8593:28: warning: suggest parentheses around ‘&&’ within ‘||’
[-Wparentheses]
        :   IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop)

op.c

diff --git a/op.c b/op.c
index c3e9f80..ebfa04d 100644 (file)
--- a/op.c
+++ b/op.c
@@ -8590,7 +8590,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
           sub is stored in.  */
        const I32 flags =
           ec ? GV_NOADD_NOINIT
-             :   IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop)
+             :   (IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop))
               || memchr(name, ':', namlen) || memchr(name, '\'', namlen)
                    ? gv_fetch_flags
                    : GV_ADDMULTI | GV_NOINIT | GV_NOTQUAL;