Closed Bug 610228 Opened 15 years ago Closed 14 years ago

Fix warnings when embedding

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: philip, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 1 obsolete file)

Attached patch fix some warnings (obsolete) — Splinter Review
When embedding SpiderMonkey (from tracemonkey 636b1e5a994f) in an otherwise warning-clean application which uses flags including -Wunused-parameter and -Wredundant-decls, I get the following warnings: jsapi.h:3323: warning: unused parameter ‘cx’ jsapi.h:3364: warning: unused parameter ‘cx’ jsobj.h:1293: warning: unused parameter ‘cx’ jsvalue.h:526: warning: unused parameter ‘why’ jsvalue.h:946: warning: redundant redeclaration of ‘JSBool (* js::Valueify(JSBool (*)(JSContext*, JSObject*, const jsval*, JSBool*)))(JSContext*, JSObject*, const js::Value*, JSBool*)’ in same scope jsvalue.h:942: warning: previous declaration of ‘JSBool (* js::Valueify(JSBool (*)(JSContext*, JSObject*, const jsval*, JSBool*)))(JSContext*, JSObject*, const js::Value*, JSBool*)’ jsvalue.h:947: warning: redundant redeclaration of ‘JSBool (* js::Jsvalify(JSBool (*)(JSContext*, JSObject*, const js::Value*, JSBool*)))(JSContext*, JSObject*, const jsval*, JSBool*)’ in same scope jsvalue.h:943: warning: previous declaration of ‘JSBool (* js::Jsvalify(JSBool (*)(JSContext*, JSObject*, const js::Value*, JSBool*)))(JSContext*, JSObject*, const jsval*, JSBool*)’
Do you need a reviewer for this?
Oops, yes. (I always forget to do this properly.)
Updated to fix warnings on Windows too.
Attachment #488754 - Attachment is obsolete: true
Attachment #489277 - Flags: review?(shaver)
Whiteboard: [build_warning]
Blocks: buildwarning
Comment on attachment 489277 [details] [diff] [review] fix some more warnings Shaver's not reviewing patches so much these days, I think. As far as the patch goes: Should there be a JS_MARK_UNUSED macro instead of the (void)cx stuff? That seems a little nicer, cuts out the oft-repeated comment. The win32-ifdefs should be as narrowly scoped as possible. I'm pretty sure this can be scoped a little narrower -- to just JSValueType and friends, roughly. As far as the jsvalue.h pragmas go, those we should just convert to == JS_TRUE (assuming that's what the problem is). Then again, a lot of code's changed since this patch was posted. How much of it still applies, and is needed? Whip up an adjusted patch and I'll review quickly.
Attachment #489277 - Flags: review?(shaver)
No warning on current code on linux using gcc 4.6.1 in jsapi.h, jsobj.h and jsvalue.h. Suggest closing this bug.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: