Closed Bug 1005667 Opened 5 years ago Closed 5 years ago

pkixtestutil.cpp:533:9: warning: logical not is only applied to the left hand side of this comparison [,-Wlogical-not-parentheses] (error in warnings-as-errors builds)

Categories

(Core :: Security, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: dholbert, Assigned: briansmith)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Build warning with clang 3.4, on mozilla-inbound, treated as error in builds with --enable-warnings-as-errors:
{
security/pkix/test/lib/pkixtestutil.cpp:533:9: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
     if (!output.Add(critical) != der::Success) {
         ^                     ~~
}

Do we really want to negate the result of "Add()" before we compare it to Success?  Looks like a bug.  If we do, we can put parens around the "!..." expression to silence the warning, I think.


This line just landed on inbound earlier today, in
 https://hg.mozilla.org/integration/mozilla-inbound/rev/2a5624d51bd3
for bug 1005198.
Flags: needinfo?(brian)
Attached patch dholbert.patchSplinter Review
I marked this as r=dholbert since you identified the typo and the fix, and I just fixed the thing you told me to fix:

https://tbpl.mozilla.org/?tree=Mozilla-Inbound
Assignee: nobody → brian
Status: NEW → ASSIGNED
Attachment #8417064 - Flags: review+
Flags: needinfo?(brian)
Sounds good to me.  Thanks for the quick action!
Blocks: buildwarning
https://hg.mozilla.org/mozilla-central/rev/25d1dbbba141
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.