[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: abort vs. assert
From: |
Bruno Haible |
Subject: |
Re: abort vs. assert |
Date: |
Mon, 15 Mar 2010 22:36:26 +0100 |
User-agent: |
KMail/1.9.9 |
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
of negated assertions like
if (index < 0 || index >= count)
return -1;
> #ifdef NDEBUG
> # error "disable assertions herein at your peril -- and if you disable
> then nonetheless, then don't report bugs"
> #endif
Hehe, I guess I would attract some complaints if I was to publish such code ;-)
Bruno
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Chen Guo, 2010/03/08
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Bruno Haible, 2010/03/08
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Chen Guo, 2010/03/08
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Chen Guo, 2010/03/08
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Bruno Haible, 2010/03/14
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Paolo Bonzini, 2010/03/15
- Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Jim Meyering, 2010/03/15
- Re: abort vs. assert, Bruno Haible, 2010/03/15
- Re: abort vs. assert, Jim Meyering, 2010/03/15
- Re: abort vs. assert,
Bruno Haible <=
- Re: abort vs. assert, Paolo Bonzini, 2010/03/16
Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Chen Guo, 2010/03/10
Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited., Bruno Haible, 2010/03/14