On 2012/01/14 13:52:44, Yury Semikhatsky wrote:
I can add an artificial usages of string1 and string2 but the failure
sounds
wrong since v8::Local protects the strings from being GC'ed. I don't see
why I
cannot have assigned but never used scoped_ptr as a method local variable.
Well, language wise is allowed - thus the compiler only warns. The warning
is
GCC new since 4.7.
However, as v8 is compiled with -Wall (which implies in GCC 4.7
-Werror=unused-but-set-variable) and with -Werror (treat warnings as error),
this will lead to build failures with GCC 4.7.
The warning makes sense as unused variables usually indicate dead code (and
sometimes even algorithmic bugs).
What is recommended way of dealing with such warnings in v8?
For real code: - usually - to remove those variables. For test code: No
idea.
Removing the variables? Adding an artificial use? Changing the compiler
options?
Btw, is there a build bot using GCC4.7 where I could see the failure?
I don't think that there is already a GCC 4.7 bot available. Nevertheless, I
would appreciate if one could build v8 with GCC 4.7.
Regarding the failure, the message is a simple:
test-api.cc:13721:25: error: variable 'string1' set but not used
Tobias,
who is a mere user of v8 and cannot provide any official guidance
http://codereview.chromium.org/9139018/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev