Closed Bug 1020414 Opened 11 years ago Closed 10 years ago

gcc -Wuninitialized warning (uninitialized memory copy) in Nullable's copy ctor when copying default constructed Nullable

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1025173

People

(Reporter: cpeterson, Unassigned)

References

(Blocks 1 open bug)

Details

I see the following gcc -Wuninitialized warning about an uninitialized memory copy from this code: https://hg.mozilla.org/mozilla-central/annotate/c7fdd7e755cd/dom/quota/QuotaManager.cpp#l2812 Here is a simplified example: > Nullable a; > Nullable b(a); // b's copy ctor copying a's uninitialized mValue In file included from ../../dist/include/nsIDOMEventTarget.h:18:0, from ../../dist/include/mozilla/dom/EventTarget.h:9, from ../../dist/include/nsPIDOMWindow.h:16, from /builds/slave/try-l64-d-00000000000000000000/build/dom/quota/CheckQuotaHelper.cpp:15, from /builds/slave/try-l64-d-00000000000000000000/build/obj-firefox/dom/quota/Unified_cpp_dom_quota0.cpp:2: ../../dist/include/mozilla/dom/Nullable.h: In member function 'nsresult mozilla::dom::quota::QuotaManager::ClearStoragesForApp(uint32_t, bool)': ../../dist/include/mozilla/dom/Nullable.h:44:27: warning: '*((void*)& persistenceType +4)' may be used uninitialized in this function [-Wuninitialized] In file included from /builds/slave/try-l64-d-00000000000000000000/build/obj-firefox/dom/quota/Unified_cpp_dom_quota0.cpp:28:0: /builds/slave/try-l64-d-00000000000000000000/build/dom/quota/QuotaManager.cpp:2808:29: note: '*((void*)& persistenceType +4)' was declared here
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.