Re: getting the "=" vs. "==" warning from glib in g_return_if_fail



>> Daniel Elstner <daniel elstner gmx net> writes:
>>>   g_return_if_fail (widget_segment->type = &gtk_text_child_type);

> Am Sam, 2002-02-09 um 21.28 schrieb Havoc Pennington:
>> Yes, please go ahead. (I guess gcc didn't warn about that because the
>> return_if_fail macro adds parens?)

On 2/9/02 1:17 PM, "Daniel Elstner" <daniel elstner gmx net> wrote:
> Yes, because it negates the expression:
> 
>   if (!(expr)) ...
> 
> However, one could replace it by
> 
>   if (expr) {} else ...

So is it OK to make this change in <glib/gmessages.h> for g_assert,
g_return_if_fail, and g_return_val_if_fail? I'd really like to see it. Owen?
Tim? If you give the OK, I'll commit the change.

    -- Darin




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