Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: runtime/platform/globals.h

Issue 24944003: Prefix compile-time typedef checks with __attribute__((unused)) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fix Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/platform/assert.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 9c418360c001269fe0b7b2d379439612332ccd49..f3dbb882d2d6b27e15336c3cf2070d9e9aea3822 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -173,6 +173,14 @@ typedef double fpu_register_t;
#error Automatic compiler detection failed.
#endif
+// DART_UNUSED inidicates to the compiler that a variable/typedef is expected
+// to be unused and disables the related warning.
+#ifdef __GNUC__
+#define DART_UNUSED __attribute__((unused))
+#else
+#define DART_UNUSED
+#endif
+
#if !defined(TARGET_ARCH_MIPS)
#if !defined(TARGET_ARCH_ARM)
#if !defined(TARGET_ARCH_X64)
@@ -392,7 +400,7 @@ template <class D, class S>
inline D bit_cast(const S& source) {
// Compile time assertion: sizeof(D) == sizeof(S). A compile error
// here means your D and S have different sizes.
- typedef char VerifySizesAreEqual[sizeof(D) == sizeof(S) ? 1 : -1];
+ DART_UNUSED typedef char VerifySizesAreEqual[sizeof(D) == sizeof(S) ? 1 : -1];
D destination;
// This use of memcpy is safe: source and destination cannot overlap.
« no previous file with comments | « runtime/platform/assert.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698