On 2015/6/30 05:06 PM, Eric Botcazou wrote: >> I notice the way gcc_assert() is defined in system.h now, the test won't >> disappear even when runtime checks are disabled, though you might still >> adjust it to avoid any programmer confusion. > > It will disappear at run time, see the definition: > > /* Include EXPR, so that unused variable warnings do not occur. */ > #define gcc_assert(EXPR) ((void)(0 && (EXPR))) > > so you really need to use a separate variable. >
I was referring to this one: #if ENABLE_ASSERT_CHECKING ... #elif (GCC_VERSION >= 4005) #define gcc_assert(EXPR) \ ((void)(__builtin_expect (!(EXPR), 0) ? __builtin_unreachable (), 0 : 0)) #else ... But yeah, I guess older GCCs could be used to build a toolchain, so a separate variable should be used. Chung-Lin