dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Wuninitialized]

RESOLVED FIXED in Firefox 40

Status

()

Core
Canvas: WebGL
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8598441 [details] [diff] [review]
Wuninitialized_newBound.patch

This patch moves the UpdateUpperBound() function's `out_upperBound` parameter to a local variable to work around a false positive -Wuninitialized gcc warning about std::max() template function's arguments in DEBUG PGO builds. PGO opt builds are not affected. The false positive warning is actually about UpdateUpperBound()'s `newBound` variable, not `out_upperBound`, but dereferencing the out_upperBound pointer into a local variable seems less silly than duplicating the newBound parameter into a local variable like `uint32_t newBound2 = newBound` (which also works around the false positive warning).

Why accept this silly workaround for a false positive warning? Because it's the last -Wuninitialized warning in mozilla-central and will allow me to land bug 1001975, removing -Wuninitialized from the warnings exempted from FAIL_ON_WARNINGS warnings-as-errors. gcc's -Wuninitialized has a well-deserved reputation for reporting false positives, but gcc 4.7 (mozilla-central's current minimum gcc version) separated -Wuninitialized's less reliable checks into a new and unreliable -Wmaybe-uninitialized warning. -Wuninitialized warnings are rarely false positives these days.

This patch also changes some (unrelated) MOZ_ASSERTs to MOZ_RELEASE_ASSERTs in the TestWebGLElementArrayCache.cpp file that triggered this -Wuninitialized warning.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=05dd713f8de1

/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
/builds/slave/try-l64-d-00000000000000000000/build/src/dom/canvas/compiledtest/../WebGLElementArrayCache.cpp:245:10: error: 'newBound' may be used uninitialized in this function [-Werror=uninitialized]
Attachment #8598441 - Flags: review?(jgilbert)
Attachment #8598441 - Flags: review?(jgilbert) → review+
Comment hidden (obsolete)
https://hg.mozilla.org/mozilla-central/rev/7b6a610e26b9
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.