Closed Bug 1219392 Opened 5 years ago Closed 5 years ago

Capitalize mozilla::unused to avoid conflicts

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox44 --- affected
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: poiru, Assigned: poiru)

References

Details

Attachments

(1 file)

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.
(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)
(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+
https://hg.mozilla.org/mozilla-central/rev/7ec70e0c6997
Status: ASSIGNED → RESOLVED
Closed: 5 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.