Closed Bug 1130828 Opened 6 years ago Closed 6 years ago

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

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.