Last Comment Bug 683998 - GCC 4.6 build warning: "jstracer.cpp:17174:20: warning: variable 'v' set but not used [-Wunused-but-set-variable]"
: GCC 4.6 build warning: "jstracer.cpp:17174:20: warning: variable 'v' set but ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Daniel Holbert [:dholbert]
:
Mentors:
Depends on:
Blocks: buildwarning 606650
  Show dependency treegraph
 
Reported: 2011-09-01 12:17 PDT by Daniel Holbert [:dholbert]
Modified: 2011-09-02 08:42 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix: remove unused variable (886 bytes, patch)
2011-09-01 12:19 PDT, Daniel Holbert [:dholbert]
wmccloskey: review+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2011-09-01 12:17:29 PDT
Filing bug on this GCC 4.6 build warning:
js/src/jstracer.cpp:17174:20: warning: variable 'v' set but not used [-Wunused-but-set-variable]

Here's the chunk of code, quoted from the cset that added it (for bug 606650):
>   1.134 +    } else if (op == JSOP_AND) {
>   1.135 +        bool b = !!js_ValueToBoolean(cx->regs->sp[-1]);
>   1.136 +        StackValue v = stackAt(-1);
>   1.137 +        if (b)
>   1.138 +            stackPop();
>   1.139 +    } else {
https://hg.mozilla.org/mozilla-central/rev/81fa7d0b8f00#l1.134

Looks indeed like |v| is unused there (and I assume (?) the stackAt(-1) call doesn't have any side effects that need to take place).

So, I think that line (marked 1.136 above) can simply be deleted.
Comment 1 Daniel Holbert [:dholbert] 2011-09-01 12:19:04 PDT
Created attachment 557600 [details] [diff] [review]
fix: remove unused variable
Comment 2 Daniel Holbert [:dholbert] 2011-09-01 15:25:15 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/3959615183f6

Note You need to log in before you can comment on or make changes to this bug.