Reviewers: Yang, Jakob,
Message:
GCC 4.8 has a new check warning: -Wunused-local-typedefs. That warning is
enabled by -Wall and due to -Werror it prevents the compilation with of v8
with
GCC 4.8.
v8's CHECK_STATIC check (in src/checks.h) uses a typedef to test whether a
condition can be evaluated at compile time or not. As the typedef is only
used
for that purpose, the warning gets triggered.
As I do not see an easy way out, I suggest to simply silence the warning. An
alternative would be to find a clever replacement.
At least with GCC 4.7, the -Wno-unused-local-typedefs flag gets ignored,
but I
think GCC ignores all unknown -Wno-* flags. Hence, this change should also
work
with older GCCs.
Tobias
Description:
Compile with -Wno-unused-local-typedefs to prevent compilation with GCC 4.8
from
failing. The problem is that STATIC_CHECK internally uses a typedef which is
only used as check whether a condition is compile-time evaluatable. As it
is not
otherwise used, GCC warns about "locally defined but not used".
BUG=v8:2149
Please review this at http://codereview.chromium.org/10449006/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M build/common.gypi
M build/standalone.gypi
Index: build/common.gypi
===================================================================
--- build/common.gypi (revision 11639)
+++ build/common.gypi (working copy)
@@ -320,7 +320,8 @@
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or
OS=="netbsd"', {
'cflags':
[ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
- '-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
+ '-Wnon-virtual-dtor', '-Woverloaded-virtual',
+ '-Wno-unused-local-typedefs' ],
}],
],
}, # Debug
Index: build/standalone.gypi
===================================================================
--- build/standalone.gypi (revision 11639)
+++ build/standalone.gypi (working copy)
@@ -91,6 +91,7 @@
or OS=="netbsd"', {
'target_defaults': {
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
+ '-Wno-unused-local-typedefs',
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
'-fno-exceptions', '-pedantic' ],
'ldflags': [ '-pthread', ],
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev