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

RESOLVED FIXED in Firefox 40

Status

()

defect
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

(Blocks 1 bug)

unspecified
mozilla40
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

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
https://hg.mozilla.org/mozilla-central/rev/f5782f959c94
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.