Fix clang -Widiomatic-parentheses and -Wsemicolon-before-method-body warnings

RESOLVED FIXED in Firefox 38

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

(Blocks 1 bug)

unspecified
mozilla38
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox38 fixed)

Details

Attachments

(1 attachment)

These particular warning instances are harmless, but they are the only instances of these warnings in the tree, so it be nice to fix them on the path to zero warnings. :)

> dom/system/mac/CoreLocationLocationProvider.mm:47:12 [-Widiomatic-parentheses] using the result of an assignment as a condition without parentheses
> widget/cocoa/nsMenuBarX.mm:752:12 [-Widiomatic-parentheses] using the result of an assignment as a condition without parentheses
> widget/cocoa/nsMenuBarX.mm:761:12 [-Widiomatic-parentheses] using the result of an assignment as a condition without parentheses

> widget/cocoa/nsCocoaWindow.mm:3349:81 [-Wsemicolon-before-method-body] semicolon before method body is ignored
> widget/cocoa/nsMenuBarX.mm:800:70 [-Wsemicolon-before-method-body] semicolon before method body is ignored
Attachment #8560978 - Flags: review?(smichaud)
Comment on attachment 8560978 [details] [diff] [review]
Widiomatic-parentheses.patch

This looks fine to me.

-- (NSPoint)fullScreenButtonPositionWithDefaultPosition:(NSPoint)aDefaultPosition;
+- (NSPoint)fullScreenButtonPositionWithDefaultPosition:(NSPoint)aDefaultPosition

-- (void)_performActionWithHighlightingForItemAtIndex:(NSInteger)index;
+- (void)_performActionWithHighlightingForItemAtIndex:(NSInteger)index

It's interesting that Apple has finally decided to warn about this particular error.  For years they silently fixed it.
Attachment #8560978 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/mozilla-central/rev/b9f575d77835
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.