Closed
Bug 682946
Opened 13 years ago
Closed 13 years ago
GCC 4.6 build warning: "nsJSEnvironment.cpp:2248:12: warning: variable 'flags' set but not used [-Wunused-but-set-variable]"
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: dholbert, Assigned: mrbkap)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.24 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
Filing bug on this build warning, seen in GCC 4.6 on x86_64 linux: /mozilla/dom/base/nsJSEnvironment.cpp: In member function 'virtual nsresult nsJSContext::CreateOuterObject(nsIScriptGlobalObject*, nsIScriptGlobalObject*)': /mozilla/dom/base/nsJSEnvironment.cpp:2248:12: warning: variable 'flags' set but not used [-Wunused-but-set-variable] The code in question: > 2241 nsresult > 2242 nsJSContext::CreateOuterObject(nsIScriptGlobalObject *aGlobalObject, > 2243 nsIScriptGlobalObject *aCurrentInner) > 2244 { [...] > 2248 PRUint32 flags = 0; > 2249 > 2250 if (chromeWindow) { > 2251 // Flag this window's global object and objects under it as "system", > 2252 // for optional automated XPCNativeWrapper construction when chrome JS > 2253 // views a content DOM. > 2254 flags = nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT; It looks like we're expecting |flags| to have an effect, but clearly (per the GCC warning) its value is never read. This changed here, as part of bug 586083: https://hg.mozilla.org/mozilla-central/diff/ad65187427e8/dom/base/nsJSEnvironment.cpp#l1.91 That cset removed the only use of |flags| -- specifically, it replaced a call to... xpc->InitClassesWithNewWrappedGlobal(..., flags, ...) ...with... xpc->WrapNative(...) mrbkap: Do you know if we still should be using |flags| at all, or if we can just drop it entirely?
Assignee | ||
Comment 1•13 years ago
|
||
We can drop it entirely. I'll have a patch in a second.
Assignee | ||
Comment 2•13 years ago
|
||
Updated•13 years ago
|
Attachment #557962 -
Flags: review?(jst) → review+
Comment 3•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/3a37edcaa27f
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•