diff --git a/src/shared/macro.h b/src/shared/macro.h index d53b07f..834593b 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -46,6 +46,13 @@ #define _alignas_(x) __attribute__((aligned(__alignof(x)))) #define _cleanup_(x) __attribute__((cleanup(x))) +#if __GNUC__<4 || ( __GNUC__==4 && __GNUC_MINOR__<6 ) +# define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT +# define DISABLE_WARNING_FORMAT_NONLITERAL +# define DISABLE_WARNING_MISSING_PROTOTYPES +# define DISABLE_WARNING_NONNULL +# define REENABLE_WARNING +#else /* Temporarily disable some warnings */ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \ _Pragma("GCC diagnostic push"); \ @@ -65,6 +72,7 @@ #define REENABLE_WARNING \ _Pragma("GCC diagnostic pop") +#endif /* automake test harness */ #define EXIT_TEST_SKIP 77 @@ -173,7 +181,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRETTY_FUNCTION__); \ } while (false) -#if defined(static_assert) +#if 0 /* static_assert() is sometimes defined in a way that trips up * -Wdeclaration-after-statement, hence let's temporarily turn off * this warning around it. */