Issue 95379 - tools: ambiguous operator precedence
Summary: tools: ambiguous operator precedence
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: DEV300m34
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: Stephan Bergmann
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-10-23 16:02 UTC by caolanm
Modified: 2008-11-26 08:36 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch, that assumes implicit precedence is correct (26.70 KB, patch)
2008-10-23 16:03 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-10-23 16:02:06 UTC
So, my recent gcc has some extra warnings about dodgy looking implicit operator
precedence.

The following patch just enforces the current implicit operator precedence, i.e.
<< before & before | before && before || so it changes nothing except to make
those warnings go away.

It all looks ok except maybe for source/fsys/urlobj.cxx where we have...
while (p != pEnd && INetMIME::isHexDigit(*p) || *p == ':' || *p == '.')
where a && b || c || d is effectively (((a && b) || c) || d) i.e.
while ((p != pEnd && INetMIME::isHexDigit(*p)) || *p == ':' || *p == '.')
is this what is truly intended or is it intended to be
while (p != pEnd && (INetMIME::isHexDigit(*p) || *p == ':' || *p == '.'))
Comment 1 caolanm 2008-10-23 16:03:09 UTC
Created attachment 57417 [details]
patch, that assumes implicit precedence is correct
Comment 2 carsten.driesner 2008-10-23 16:11:21 UTC
cd->sb: Could you please check the patch from Caolan.
Comment 3 Stephan Bergmann 2008-10-23 16:27:13 UTC
@cmc:  The fix for source/fsys/urlobj.cxx should read

  while (p != pEnd && (INetMIME::isHexDigit(*p) || *p == ':' || *p == '.'))

(i.e., the current code is wrong, and the extra warning helped find an error). 
Either integrate yourself, or pass back to me and I will add it to some CWS...
Comment 4 caolanm 2008-10-23 16:35:53 UTC
will take for cmcfixes50
Comment 5 caolanm 2008-10-23 16:36:43 UTC
done
Comment 6 caolanm 2008-11-05 16:57:33 UTC
cmc->sb: happy to verify this in cmcfixes50 ?
Comment 7 caolanm 2008-11-07 16:15:38 UTC
set to "verified" as its the agreed patch
Comment 8 Stephan Bergmann 2008-11-26 08:36:43 UTC
.