On Mon, Mar 15, 2010 at 22:36, Bruno Haible wrote:
> Hi Jim,
>
>> You might just as well define and use your own macro,
>>
>> #define ASSERT(e) do { if (!(e)) abort (); } while (0)
>
> Oh yes, this one is perfectly fine with me.
But it wouldn't protect you from
#define abort __builtin_unreac
Hi Jim,
> You might just as well define and use your own macro,
>
> #define ASSERT(e) do { if (!(e)) abort (); } while (0)
Oh yes, this one is perfectly fine with me.
> you assert a condition rather than testing its negation.
Good point. Yes, I too get confused when reading through a bunch
Bruno Haible wrote:
> Jim Meyering wrote:
>> These days, I prefer to use assert(e) over "if (!e) abort();".
>> We used to have to avoid using assert due to portability issues,
>> but those went away many years ago.
>
> I disagree. The reason why I never use 'assert(e)' is to make sure
> the safety
Jim Meyering wrote:
> These days, I prefer to use assert(e) over "if (!e) abort();".
> We used to have to avoid using assert due to portability issues,
> but those went away many years ago.
I disagree. The reason why I never use 'assert(e)' is to make sure
the safety checks are actually present.