Closed Bug 1125698 Opened 10 years ago Closed 10 years ago

js/src/jscntxt.cpp:862:74: warning: variable 'dummy' is uninitialized when used here [-Wuninitialized]

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

clang warns that js_ReportErrorNumberUCArray() passes va_list dummy to js_ExpandErrorArguments() without having initialized dummy with va_start. However, js_ReportErrorNumberUCArray() is not a variadic function, so it can't call va_start() itself without clang emitting a -Wvarargs warning. js/src/jscntxt.cpp:862:74: warning: variable 'dummy' is uninitialized when used here [-Wuninitialized]
1. Add ExpandErrorArguments() varargs helper function and remove uninitialized `dummy` va_list variable. 2. Rename original ExpandErrorArguments() function to ExpandErrorArgumentsVA() like other SpiderMonkey functions that take a va_list parameter (and to differentiate it from the new helper function). https://treeherder.mozilla.org/#/jobs?repo=try&revision=97a6af09b2a6
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Attachment #8584954 - Flags: review?(jwalden+bmo)
Attachment #8584954 - Flags: review?(jwalden+bmo) → review+
Thanks. I believe this was the last -Wuninitialized from clang and gcc in mozilla-central. https://hg.mozilla.org/integration/mozilla-inbound/rev/f5782f959c94
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: