Closed Bug 1248681 Opened 8 years ago Closed 8 years ago

Add MOZ_WARN_UNUSED_RESULT to all of our OOM sensitive APIs

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: terrence, Assigned: terrence)

Details

Attachments

(1 file)

I expect this will almost certainly surface some latent leak bugs.
Added annotations to everything that looked likely in JSCompartment and JS::Zone. Found one missing check in JS_TransplantObject.
Assignee: nobody → terrence
Status: NEW → ASSIGNED
Attachment #8719976 - Flags: review?(sphink)
Comment on attachment 8719976 [details] [diff] [review]
warn_unused_putWrapper-v0.diff

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

Oh, wow. I guess somehow I had thought that we already had that warning on by default, and were casting to (void) or whatever the places where we were intentionally not checking. Out of curiousity, do you know how many warnings we get if we turn it on globally?
Attachment #8719976 - Flags: review?(sphink) → review+
(In reply to Steve Fink [:sfink, :s:] from comment #2)
> Comment on attachment 8719976 [details] [diff] [review]
> warn_unused_putWrapper-v0.diff
> 
> Review of attachment 8719976 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Oh, wow. I guess somehow I had thought that we already had that warning on
> by default, and were casting to (void) or whatever the places where we were
> intentionally not checking. Out of curiousity, do you know how many warnings
> we get if we turn it on globally?

I don't think there are any compilers that will do that, sadly. Maybe something for the analysis?
https://hg.mozilla.org/mozilla-central/rev/ec2ea269b3de
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: