From 5db22494934779a3e7fb7669379d1693ff19d39f Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Tue, 2 Apr 2013 09:51:47 -0700 Subject: Avoid spurious GCC warnings in STATIC_ASSERT() macro. GCC 4.8 now warns about typedefs that are local to a scope and not used anywhere within that scope. This produced spurious warnings with the STATIC_ASSERT() macro (which used a typedef to provoke a compile error in the event of an assertion failure). This patch switches to a simpler technique that avoids the warning. v2: Avoid GCC-specific syntax. Also update p_compiler.h. Reviewed-by: Kenneth Graunke --- src/gallium/include/pipe/p_compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/include/pipe/p_compiler.h') diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index a131969c6eb..78ec83c8489 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -255,7 +255,7 @@ void _ReadWriteBarrier(void); */ #define STATIC_ASSERT(COND) \ do { \ - typedef int static_assertion_failed[(!!(COND))*2-1]; \ + (void) sizeof(char [1 - 2*!(COND)]); \ } while (0) -- cgit v1.2.3