Re: [CHECKER] Is this a bug?

Giacomo Catenazzi (cate@debian.org)
Fri, 02 Nov 2001 11:09:49 +0100


>
> Also (in a separate patch at the end) is the removal of a whole bunch of:
>
> #ifdef IP2DEBUG_TRACE
> ip2trace(foo);
> #endif
>
> and replacing it with (the Linus-preferred, and far cleaner):
>
> #ifdef IP2DEBUG_TRACE
> void ip2trace(foo)
> #else
> #define ip2trace(foo) do {} while (0)
> #endif
>

Why in Linux we use "do {} while (0)" instead of the
standard "(void)0" ?
(standard = as normal libc in <assert.h>)

do while(0) is used for multiple statment macro to avoid problem
in if-else, not for empty instructions.

giacomo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/