Re: g_return_if_fail() breakage



On 26 Nov 2002, Matthias Clasen wrote:

> On Tue, 2002-11-26 at 02:40, Daniel Elstner wrote:
>
> > To fix this either g_return_if_fail() or G_LIKELY() should add parens.
> > The latter is probably the safest option, even though we'd definitely
> > lose the warning feature with -O0 or other compilers than GCC.
>
> Already fixed in CVS, thanks to our alert build sheriff Dan Mills.

adding parens is not a good idea, because of loosing compiler checks
for x=5 instead of x==5 that way.
a better fix is if (G_LIKELY (expr)) ; else g_log (...
and not having G_LIKELY/G_UNLIKELY add extra parens.

>
> Matthias
>

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]