Remove deprecated header Unused.h
Categories
(Core :: MFBT, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox146 | --- | fixed |
People
(Reporter: sergesanspaille, Assigned: sergesanspaille)
References
Details
Attachments
(3 files, 1 obsolete file)
This header is flagged as deprecated by config/check_spidermonkey_style.py and can indeed be repalced by a cast to (void)
| Assignee | ||
Comment 1•5 months ago
|
||
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by [[maybe_unused]] but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 2•5 months ago
|
||
grep -l '\<mozilla::Unused> <<' **/.(cc|cpp|h)(.) | xargs sed -i -e 's/mozilla::Unused << /(void)/g'
grep -l '\<Unused> <<' **/.(cc|cpp|h)(.) | xargs sed -i -e 's/Unused << /(void)/g'
grep -l mozilla/Unused.h **/*.(cc|cpp|h)(.) | xargs sed -i -e '/^# *include "mozilla/Unused.h"$/ d'
./mach lint --rev @ --linter clang-format --fix
Comment 3•5 months ago
|
||
Comment 4•5 months ago
|
||
(In reply to [:sergesanspaille] from comment #0)
This header is flagged as deprecated by
config/check_spidermonkey_style.pyand can indeed be repalced by a cast to(void)
Apparently this was added in bug 1713212. And there was already a bug tracking its removal, at bug 1628542, also with a note to do a bit more than just replacing Unused << with (void). I have no particular opinion here, I'm flagging this in case it is relevant.
Comment 7•5 months ago
|
||
Backed out for causing bustages on Document.cpp
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/62dbe7e243150b1fee1fc9e9523a10606a093fbb
Log link: https://treeherder.mozilla.org/logviewer?job_id=532261382&repo=autoland&task=BE8P1CKfRt6QGwSoirWJ0A.0&lineNumber=67669
Comment 10•5 months ago
•
|
||
Backed out for causing build bustage at nsBrowserApp.cpp
Comment 11•5 months ago
|
||
Comment 12•5 months ago
|
||
Comment 13•5 months ago
|
||
Backed out for causing Gtest failures on AlreadyAddRefed.h
Comment 14•5 months ago
|
||
Comment 15•5 months ago
|
||
There has been 3 immediate backouts on this bug, of a patch that spans over 1000 files.
Once these commits reach the firefox-main repo (and mozilla-central too?), could we append the commit hashes of the 6 commits (3x land & revert) to the .git-blame-ignore-revs and .hg-annotate-ignore-revs files at the top of the repo to make git blame less painful?
- https://searchfox.org/firefox-main/rev/50a34d25155fd70628ee69c7d68a2509c0e3445d/.hg-annotate-ignore-revs
- https://searchfox.org/firefox-main/rev/50a34d25155fd70628ee69c7d68a2509c0e3445d/.git-blame-ignore-revs
(I don't know what the guidelines are for adding/not adding entries, but I would expect multiple giant commits spanning 1000+ files each to make the cut).
| Assignee | ||
Comment 16•5 months ago
|
||
Will do, letting a few days flow beforehand though.
Comment 17•5 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 18•5 months ago
|
||
Those 6 commits each touch ~1000 files, they will clutter git blame
history, better ignore them.
| Assignee | ||
Updated•5 months ago
|
Comment 20•5 months ago
|
||
Comment 21•5 months ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Comment 22•5 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
Updated•4 months ago
|
Updated•2 months ago
|
Description
•