develooper Front page | perl.perl5.porters | Postings from July 2003

[perl #23065] "Possible precedence problem on bitwise %c operator" comes up erroneously

Thread Next
From:
Jason Rhinelander
Date:
July 20, 2003 13:57
Subject:
[perl #23065] "Possible precedence problem on bitwise %c operator" comes up erroneously
Message ID:
rt-23065-61529.5.01190592050037@rt.perl.org
# New Ticket Created by  Jason Rhinelander 
# Please include the string:  [perl #23065]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23065 >


This is a bug report for perl from jason-cytherea@gossamer-threads.com,
generated with the help of perlbug 1.34 running under perl v5.8.1.


-----------------------------------------------------------------
The new Perl 5.8.1 warning: "Possible precedence problem on bitwise %c
operator" comes up incorrectly for bitwise assignment operators (as of
at least 5.8.1-RC2).  The following example demonstrates:

$ perl -wle '$a=$b=1; $a ^= $b == 1'
Possible precedence problem on bitwise ^ operator at -e line 1.

It makes sense for it to come up with:

$foo = $foo ^ $bar == 2;

- but that isn't the same thing at all, since '^=' has an entirely
different precendent from '^'.  In the above (first) example, there
most likely _isn't_ a precedence problem because of the low assignment
precedence.  This applies to all bitwise assignment operators, not
just ^=.

-- Jason Rhinelander
-- Gossamer Threads, Inc.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.8.1:

Configured by jagerman at Sat Jul 19 23:05:42 PDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.20-gentoo-r5, archname=i686-linux-thread-multi
    uname='linux cytherea.office.gossamer-threads.com 2.4.20-gentoo-r5 #1 sat may 10 15:50:44 pdt 2003 i686 amd athlon(tm) xp authenticamd gnulinux '
    config_args='-des -Darchname=i686-linux-thread -Dcc=gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-march=athlon-xp -O3 -mmmx -msse -m3dnow -mfpmath=sse -pipe -fomit-frame-pointer -fforce-addr -funroll-loops -frerun-loop-opt -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman3ext=3pm -Dcf_by=Gentoo -Ud_csh -Dusethreads -Di_gdbm -Di_db -Di_ndbm'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-march=athlon-xp -O3 -mmmx -msse -m3dnow -mfpmath=sse -pipe -fomit-frame-pointer -fforce-addr -funroll-loops -frerun-loop-opt',
    cppflags='-DPERL5 -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing'
    ccversion='', gccversion='3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    RC2

---
@INC for perl v5.8.1:
    /etc/perl
    /usr/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.1
    /usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.1/i686-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.1
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.1/i686-linux-thread-multi
    /usr/lib/perl5/5.8.1
    /usr/local/lib/site_perl
    /usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl/5.6.1
    .

---
Environment for perl v5.8.1:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin/wrappers:/usr/lib/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/opt/ati/bin:/opt/Acrobat5:/opt/f-prot:/usr/X11R6/bin:/opt/sun-j2sdk-1.4.1/bin:/opt/sun-j2sdk-1.4.1/jre/bin:/usr/qt/3/bin:/usr/games/bin:/opt/quake3:/opt/vmware/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/opt/ati/bin:/opt/Acrobat5:/usr/X11R6/bin:/opt/sun-j2sdk-1.4.1/bin:/opt/sun-j2sdk-1.4.1/jre/bin:/usr/qt/3/bin:/opt/vmware/bin:/usr/X11R6/bin:/opt/perl/perl-5.00404/bin:/opt/perl/perl-5.005/bin:/opt/perl/perl-5.00503/bin
    PERL_BADLANG (unset)
    SHELL (unset)



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About