bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] hash.c change to use abort rather than assert


From: Paul Eggert
Subject: Re: [Bug-gnulib] hash.c change to use abort rather than assert
Date: Mon, 25 Nov 2002 16:24:11 -0800

> Date: Mon, 25 Nov 2002 20:34:56 +0100 (CET)
> From: Bruno Haible <address@hidden>
> 
> I prefer to turn
> 
>      assert (bucket < table->bucket_limit);
> 
> into
> 
>      if (!(bucket < table->bucket_limit))
>        abort ();

How about if we turn it into this instead:

    aver (bucket < table->bucket_limit);

with the following definition for "aver":

    #ifdef NDEBUG
    # define aver(X) ((void) 0)
    #else
    # define aver(X) ((X) ? (void) 0 : abort ())
    #endif

In English, "aver" is a synonym for "assert", but it's shorter
-- hinting that "aver" is smaller/faster than "assert" --
and it sounds more like "abort".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]