RFR: 8145096: Undefined behaviour in HotSpot, Take 2
Andrew Haley
aph at redhat.com
Wed Dec 16 09:23:36 UTC 2015
On 16/12/15 00:02, Ioi Lam wrote:
> Is it possible to change things like
>
> 1373 juint nrange = (juint)_hi - _lo;
>
> to
>
> 1373 juint nrange = juint(_hi) - _lo;
>
> or
>
> 1373 juint nrange = ((juint)_hi) - _lo;
>
> I found the first kind of casting difficult to read -- I constantly need
> to think, "does the cast apply to the first operand only, or the whole
> expression".
Well, type casts bind very strongly. But I do sometimes add parens
for clarity, even when technically unnecessary, just not in this case.
I'm reluctant to make such a non-standard change. I am always willing
to listen, though, and I'll wait to see what others say.
Andrew.
More information about the hotspot-dev
mailing list