<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 12, 2014 at 10:17 AM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 12.12.2014 um 15:09 schrieb Jose Fonseca:<br>
> From: José Fonseca <<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>><br>
><br>
> f0ba7d897d1c22202531acb70f134f2edc30557d made debug_assert()/assert()<br>
> unsafe for expressions, but only now with u_atomic.h started to rely on<br>
> them for Windows this became an issue.<br>
><br>
> This fixes non-debug builds with MSVC.<br>
> ---<br>
> src/gallium/auxiliary/util/u_debug.h | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h<br>
> index badd5e2..4c22fdf 100644<br>
> --- a/src/gallium/auxiliary/util/u_debug.h<br>
> +++ b/src/gallium/auxiliary/util/u_debug.h<br>
> @@ -185,7 +185,7 @@ void _debug_assert_fail(const char *expr,<br>
> #ifdef DEBUG<br>
> #define debug_assert(expr) ((expr) ? (void)0 : _debug_assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__))<br>
> #else<br>
> -#define debug_assert(expr) do { } while (0 && (expr))<br>
> +#define debug_assert(expr) (void)(0 && (expr))<br>
> #endif<br>
><br>
><br>
><br></blockquote><div><br></div><div>Just for my own education, can someone explain what the need for `debug_assert()` to have any expansion of `expr` at all? Rather, what breaks with something like:</div><div><br></div><div> #define debug_assert(expr) ((void)0)</div><div> </div><div><br></div><div><br></div></div></div></div>