Closed
Bug 1301574
Opened 9 years ago
Closed 9 years ago
Introduce mozilla::XXXUnused
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(1 file)
|
4.56 KB,
patch
|
Details | Diff | Splinter Review |
I think it will be useful to have a variant of |Unused| that indicates "we
deliberately ignore this value but we probably shouldn't".
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8789626 -
Flags: review?(nfroyd)
Comment 2•9 years ago
|
||
Why not something clearer like "ShouldBeUsed"? (or XXXShouldBeUsed)
| Assignee | ||
Comment 3•9 years ago
|
||
I expected bikeshedding about the name, that's fine. But not that at it's possible that not using the value is reasonable, so ProbablyShouldBeUsed would be more accurate (though unwieldy).
Comment 4•9 years ago
|
||
Explain why it isn't feasible to just fix the stupid code? I get the sigil-thing for switching to a new API, sometimes. But checking return values is just not on the same plane at all.
| Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #4)
> Explain why it isn't feasible to just fix the stupid code?
See the patch for three particular examples. They all came from bug 1297300 for an example of how much effort it is to do such fixes. There were a couple of hundred missing checks for GetSpec().
Sometimes papering over the current flaws in order to prevent new ones is a good idea, but if you do that, it's nice to have a clear indication where you did the papering.
Comment 6•9 years ago
|
||
Comment on attachment 8789626 [details] [diff] [review]
Introduce mozilla::XXXUnused
Review of attachment 8789626 [details] [diff] [review]:
-----------------------------------------------------------------
Is this really any more helpful than the XXX comments already at all the callsites that you're modifying? "Yes," I hear you say, "searching for XXX turns up any number of things, whereas searching for XXXUnused limits the search to these particular sites." OK, how about simply changing the comments to read XXXUnused or XXXMustUse? I get wanting to identify all the places where we should go back and re-examine papering over problems, I'm just not convinced that doing it in code is necessarily better than comments.
Attachment #8789626 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 7•9 years ago
|
||
> OK, how about simply changing the comments to read XXXUnused or XXXMustUse?
It's less reliable -- e.g. the compiler won't complain if you misspell them. Also, there's the possibility of changing the implementation of XXXUnused to actually do something, such as print a warning when the unused value is a failure, which might help identify which ones should be fixed first. (One probably wouldn't land a patch that does that, but it might be a useful thing to in a local build.)
But if you're really opposed just WONTFIX this and I will make do with comments.
| Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•