This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: [PATCH, libjava]: Avoid suggest parentheses around comparison in operand of '|' in java/lang/natObject.cc


Forwarded from gcc-patches@ ML [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2014-03/msg00481.html

---------- Forwarded message ----------
From: Uros Bizjak <ubizjak@gmail.com>
Date: Mon, Mar 10, 2014 at 9:13 PM
Subject: [PATCH, libjava]: Avoid suggest parentheses around comparison
in operand of '|' in java/lang/natObject.cc
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>


Hello!

During libjava build, following warning is reported:

../../../gcc-svn/branches/gcc-4_8-branch/libjava/java/lang/natObject.cc:932:27:
warning: suggest parentheses around comparison in operand of '|'
[-Wparentheses]
    JvAssert(he -> address == address | LOCKED );
                           ^

It looks that parentheses are missing around (address | LOCKED),
otherwise the expression is always true - LOCKED is unconditionally
defined to 1. Attached patch adds these parentheses (and removes a
pair of superfluous ones).

2014-03-10  Uros Bizjak  <ubizjak@gmail.com>

    * java/lang/natObject.cc (_Jv_MonitorEnter): Add missing parenthesis
    around comparison with (address | LOCKED) in JvAssert.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}.

OK for mainline SVN and release branches?

Uros.

Attachment: j.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]