Closed Bug 1398134 Opened 7 years ago Closed 7 years ago

Fix warning 'tempValue' may be used uninitialized in UnwrapObjectInternal

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: nical, Assigned: nical)

Details

Attachments

(1 file)

My terminal is flooded with this warning when I build mozilla-central:

> /home/nical/dev/mozilla/objdir/opt-dbg/dist/include/mozilla/RefPtr.h:193:5: warning: 'tempValue' may be used uninitialized in this function [-Wmaybe-uninitialized]
>      assign_with_AddRef(aRhs);
>      ^~~~~~~~~~~~~~~~~~
> /home/nical/dev/mozilla/objdir/opt-dbg/dist/include/mozilla/dom/BindingUtils.h:289:6: note: 'tempValue' was declared here
>    T* tempValue;
>       ^~~~~~~~~

It's not entirely clear to me if this can cause issues or if tempValue always gets initialized in the recursion and the compiler just can't see it.
In any case with this amount of warnings it becomes easy to miss other potentially important warnings.
Assignee: nobody → nical.bugzilla
Attachment #8905955 - Flags: review?(bkelly)
Attachment #8905955 - Flags: review?(bkelly) → review+
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/171282de032d
Fix warning in BindingUtils.h. r=bkelly
https://hg.mozilla.org/mozilla-central/rev/171282de032d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Improvement noticed:

== Change summary for alert #9677 (as of September 27 2017 07:14 UTC) ==

Improvements:

  3%  compiler warnings summary android-4-0-armv7-api16 opt      1,150.00 -> 1,119.00

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=9677
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: