From 74227cd7f06548a1d1afd17d4b73e361b95bd903 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 May 2014 11:11:03 +1000 Subject: [PATCH] AP_HAL: prevent some FastDelegate warnings --- libraries/AP_HAL/utility/FastDelegate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL/utility/FastDelegate.h b/libraries/AP_HAL/utility/FastDelegate.h index 9fd05ba027..1d8fef2547 100644 --- a/libraries/AP_HAL/utility/FastDelegate.h +++ b/libraries/AP_HAL/utility/FastDelegate.h @@ -176,7 +176,7 @@ inline OutputClass horrible_cast(const InputClass input){ // If the compile fails here, it means the compiler has peculiar // unions which would prevent the cast from working. typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u) - && sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1]; + && sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1] __attribute((unused)); u.in = input; return u.out; } @@ -292,7 +292,7 @@ struct SimplifyMemFunc { GenericMemFuncType &bound_func) { // Unsupported member function type -- force a compile failure. // (it's illegal to have a array with negative size). - typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100]; + typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100] __attribute((unused)); return 0; } }; @@ -778,7 +778,7 @@ public: // Ensure that there's a compilation failure if function pointers // and data pointers have different sizes. // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. - typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1]; + typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1] __attribute((unused)); m_pthis = horrible_cast(function_to_bind); // MSVC, SunC++ and DMC accept the following (non-standard) code: // m_pthis = static_cast(static_cast(function_to_bind)); @@ -793,7 +793,7 @@ public: // Ensure that there's a compilation failure if function pointers // and data pointers have different sizes. // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. - typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1]; + typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1] __attribute((unused)); return horrible_cast(this); } #endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)