Re: [CHECKER] Is this a bug?

From: Giacomo Catenazzi (cate@debian.org)
Date: Fri Nov 02 2001 - 05:09:49 EST


>
> 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/



This archive was generated by hypermail 2b29 : Wed Nov 07 2001 - 21:00:18 EST