Closed
Bug 829344
Opened 11 years ago
Closed 11 years ago
Fix gcc -Wlogical-op warnings on Android
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox20 wontfix, firefox21 affected)
RESOLVED
FIXED
Firefox 21
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Depends on 1 open bug)
Details
Attachments
(4 files)
2.94 KB,
patch
|
Details | Diff | Splinter Review | |
1.35 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
2.34 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
9.43 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
gcc's -Wlogical-op option now warns for logical expressions such as (c == 1 && c == 2) and (c != 1 || c != 2), which are likely to be mistakes.
Depends on: 828741
Assignee | ||
Comment 2•11 years ago
|
||
Fix gcc -Wlogical-op warning in GTK2 widget code: widget/gtk2/nsDragService.cpp: In function 'void OnSourceGrabEventAfter(GtkWidget*, GdkEvent*, void*)': widget/gtk2/nsDragService.cpp:239:48: warning: logical 'or' of collectively exhaustive tests is always true
Attachment #700779 -
Flags: review?(karlt)
Updated•11 years ago
|
Attachment #700779 -
Flags: review?(karlt) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Fix gcc -Wlogical-op warnings in SIP code: media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c: In function 'getPreallocatedSipCallID': media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c:12048:5: warning: logical 'and' of mutually exclusive tests is always false media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c: In function 'ccsip_find_preallocated_sip_call_id': media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c:12177:5: warning: logical 'and' of mutually exclusive tests is always false media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c: In function 'ccsip_free_preallocated_sip_call_id': media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c:12200:5: warning: logical 'and' of mutually exclusive tests is always false
Attachment #700801 -
Flags: review?(rjesup)
Updated•11 years ago
|
Attachment #700801 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/570ec5fcf213 https://hg.mozilla.org/integration/mozilla-inbound/rev/dd1f7674fcb3
Whiteboard: [leave open]
Target Milestone: --- → Firefox 21
Assignee | ||
Comment 5•11 years ago
|
||
Part 4: Fix gcc -Wlogical-op warnings from PRBool/bool conversion. These warnings are mostly obsolete checks for (bool == true || bool == false) that only made sense for PRBool. layout/base/nsBidiPresUtils.cpp:1602:49: error: logical 'or' of collectively exhaustive tests is always true layout/generic/nsCanvasFrame.cpp:150:47 [-Wlogical-op] logical 'or' of collectively exhaustive tests is always true layout/style/nsNthIndexCache.cpp:60:53: warning: logical 'or' of collectively exhaustive tests is always true netwerk/base/src/nsSimpleURI.cpp:68:43 [-Wlogical-op] logical 'and' of mutually exclusive tests is always false netwerk/base/src/nsSimpleURI.cpp:83:45 [-Wlogical-op] logical 'and' of mutually exclusive tests is always false netwerk/base/src/nsStandardURL.cpp:2750:43 [-Wlogical-op] logical 'and' of mutually exclusive tests is always false netwerk/base/src/nsStandardURL.cpp:2759:55 [-Wlogical-op] logical 'and' of mutually exclusive tests is always false netwerk/protocol/http/nsHttpChannelAuthProvider.cpp:1356:48 [-Wlogical-op] logical 'and' applied to non-boolean constant
Attachment #701179 -
Flags: review?(ehsan)
Comment 6•11 years ago
|
||
Comment on attachment 701179 [details] [diff] [review] part-4-fix-PRBool-warnings.patch Review of attachment 701179 [details] [diff] [review]: ----------------------------------------------------------------- ::: image/src/RasterImage.cpp @@ +2615,5 @@ > nsresult > RasterImage::ShutdownDecoder(eShutdownIntent aIntent) > { > // Ensure that our intent is valid > + NS_ABORT_IF_FALSE((aIntent >= 0) && (aIntent < eShutdownIntent_AllCount), Shoot! ::: layout/generic/nsCanvasFrame.cpp @@ +146,5 @@ > nsIFrame* aOldFrame) > { > NS_ASSERTION(aListID == kPrincipalList || > aListID == kAbsoluteList, "unexpected child list ID"); > + if (aListID != kPrincipalList && aListID != kAbsoluteList) { Ouch ::: netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ +1352,5 @@ > // flag. > if (nsCRT::strcmp(ident.User(), entry->User()) == 0) { > uint32_t loadFlags; > if (NS_SUCCEEDED(mAuthChannel->GetLoadFlags(&loadFlags)) && > + !(loadFlags & nsIChannel::LOAD_EXPLICIT_CREDENTIALS)) { It's nice to see that the compiler warnings caught real bugs.
Attachment #701179 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to :Ehsan Akhgari from comment #6) > It's nice to see that the compiler warnings caught real bugs. gcc is full of surprises! :) https://hg.mozilla.org/integration/mozilla-inbound/rev/98c2750c585d
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/570ec5fcf213 https://hg.mozilla.org/mozilla-central/rev/dd1f7674fcb3 https://hg.mozilla.org/mozilla-central/rev/98c2750c585d
Updated•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•