Revision: 17641
Author: [email protected]
Date: Tue Nov 12 12:09:38 2013 UTC
Log: Fix compilation with GCC 4.8
BUG=v8:2767,v8:2149
[email protected]
Review URL: https://codereview.chromium.org/69413002
http://code.google.com/p/v8/source/detail?r=17641
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/include/v8config.h
/branches/bleeding_edge/src/checks.h
/branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Tue Nov 12 11:44:58 2013 UTC
+++ /branches/bleeding_edge/include/v8.h Tue Nov 12 12:09:38 2013 UTC
@@ -5821,7 +5821,6 @@
template<typename T>
void ReturnValue<T>::Set(uint32_t i) {
TYPE_CHECK(T, Integer);
- typedef internal::Internals I;
// Can't simply use INT32_MAX here for whatever reason.
bool fits_into_int32_t = (i & (1U << 31)) == 0;
if (V8_LIKELY(fits_into_int32_t)) {
=======================================
--- /branches/bleeding_edge/include/v8config.h Mon Sep 30 13:28:23 2013 UTC
+++ /branches/bleeding_edge/include/v8config.h Tue Nov 12 12:09:38 2013 UTC
@@ -187,6 +187,7 @@
// supported
// V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated))
supported
// V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline))
supported
+// V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported
// V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility))
supported
// V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT -
__attribute__((warn_unused_result))
// supported
@@ -216,6 +217,7 @@
# define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
# define V8_HAS_ATTRIBUTE_DEPRECATED (__has_attribute(deprecated))
# define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
+# define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
# define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
(__has_attribute(warn_unused_result))
@@ -247,6 +249,7 @@
# define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0))
# define V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE (V8_GNUC_PREREQ(4, 5, 0))
# define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0))
+# define V8_HAS_ATTRIBUTE_UNUSED (V8_GNUC_PREREQ(2, 95, 0))
# define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0))
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
(!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0))
@@ -334,6 +337,14 @@
#endif
+// A macro to mark variables or types as unused, avoiding compiler
warnings.
+#if V8_HAS_ATTRIBUTE_UNUSED
+# define V8_UNUSED __attribute__((unused))
+#else
+# define V8_UNUSED
+#endif
+
+
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() V8_WARN_UNUSED_RESULT;
=======================================
--- /branches/bleeding_edge/src/checks.h Fri Oct 25 11:10:28 2013 UTC
+++ /branches/bleeding_edge/src/checks.h Tue Nov 12 12:09:38 2013 UTC
@@ -268,7 +268,7 @@
#define
STATIC_CHECK(test) \
typedef
\
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
- SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
+ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) V8_UNUSED
#endif
=======================================
--- /branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc Fri
Nov 8 17:35:58 2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc Tue Nov
12 12:09:38 2013 UTC
@@ -2327,8 +2327,8 @@
TEST(OperandOffset) {
i::V8::Initialize(NULL);
- int data[256];
- for (int i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
+ uint32_t data[256];
+ for (uint32_t i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
// Allocate an executable page of memory.
size_t actual_size;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.