Capitalize mozilla::unused to avoid conflicts

RESOLVED FIXED in Firefox 45

Status

()

defect
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: poiru, Assigned: poiru)

Tracking

Trunk
mozilla45
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox44 affected, firefox45 fixed, b2g-v2.5 fixed)

Details

Attachments

(1 attachment)

The tree has a bunch of identifiers named `unused` that conflict with `mozilla::unused`. The easiest way out is to switch to `mozilla::Unused`.

Note that the patch intentionally has no context.
Attachment #8680148 - Flags: review?(nfroyd)
Ongoing shout-out to fix compilers that don't like cast-to-void as a way to use return values!  (I am not suggesting or requiring you do this, just that mozilla::unused is stupid practice IMO.  :-) )
(In reply to Birunthan Mohanathas [:poiru] from comment #0)
> The tree has a bunch of identifiers named `unused` that conflict with
> `mozilla::unused`. The easiest way out is to switch to `mozilla::Unused`.

My impression was that this was only an issue with the Chromium-imported ipc code.  Where are the other problems?
Flags: needinfo?(birunthan)
I actually did write a patch not to long ago to eliminate the places people call things 'unused', though Nathan suggested another work around. It wasn't too bad. But of course, people are going to keep adding them.
Assignee

Comment 4

4 years ago
(In reply to Nathan Froyd [:froydnj] from comment #2)
> (In reply to Birunthan Mohanathas [:poiru] from comment #0)
> > The tree has a bunch of identifiers named `unused` that conflict with
> > `mozilla::unused`. The easiest way out is to switch to `mozilla::Unused`.
> 
> My impression was that this was only an issue with the Chromium-imported ipc
> code.  Where are the other problems?

See https://dxr.mozilla.org/mozilla-central/search?q=ext%3Acpp+regexp%3A\bunused[^\.][^%3C]\b&redirect=false&case=true

Many of those are comments, but there are still a few actual hits.
Flags: needinfo?(birunthan)
Assignee

Comment 5

4 years ago
(In reply to Birunthan Mohanathas [:poiru] from comment #4)
> See
> https://dxr.mozilla.org/mozilla-central/
> search?q=ext%3Acpp+regexp%3A\bunused[^\.][^%3C]\b&redirect=false&case=true
> 
> Many of those are comments, but there are still a few actual hits.

I forgot that DXR is smart. This is a far better search: https://dxr.mozilla.org/mozilla-central/search?q=ext%3Acpp+id%3Aunused&redirect=true&case=true
Comment on attachment 8680148 [details] [diff] [review]
Capitalize mozilla::unused to avoid conflicts

Review of attachment 8680148 [details] [diff] [review]:
-----------------------------------------------------------------

Maybe we should call it "bitbucket" instead. ;)

But yeah, the second DXR query and the since of this patch are a little more convincing.
Attachment #8680148 - Flags: review?(nfroyd) → review+

Comment 8

4 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/7ec70e0c6997
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Depends on: 1297276
You need to log in before you can comment on or make changes to this bug.