Re: turning g_assert* into warnings

BJörn Lindqvist wrote:
On 10/12/07, Emmanuele Bassi <ebassi gmail com> wrote:
On Fri, 2007-10-12 at 14:40 +0200, Mathias Hasselmann wrote:

So I guess what you really want is some kind of "g_soft_assert" or some
+1 on a g_warn_if_fail() API addition.

What is wrong with:

if (!everything_is_ok)
    g_warning ("blaha");

? Those double or triple negatives that the *_if_fail routines
introduce always confuses me: g_return_if_fail (!(flag != SOMETHING &&
x)); ugh..

You messed it up somehow. It's never triple, since our normal logic
is either "yes" or "no", the max is double negative which is positive.
Your example would be some
g_warn_if_fail (everything_is_ok, "blaha");
nothing fancy.

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