lkml.org 
[lkml]   [2001]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [CHECKER] Is this a bug?
> 
> 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/

\
 
 \ /
  Last update: 2005-03-22 13:18    [W:0.034 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site