On Mon, Feb 02, 2009 at 08:58:11AM +0100, Per Inge Mathisen wrote:
On Sun, Feb 1, 2009 at 11:55 PM, Giel van Schijndel m...@mortis.eu wrote:
It is misleading, though, since it can also be ASSERT_AND_RETURN or
just RETURN, depending on how the program is compiled and how gdb
reacts to abort
On Sat, Jan 31, 2009 at 11:45:11PM +0100, Per Inge Mathisen wrote:
No. There are in fact three places now that the expression result is checked:
1) Checking if we should log an error
2) The assert()
3) The return condition
In my patch I only cache it in the first case for the last case,
On Sun, Feb 1, 2009 at 11:55 PM, Giel van Schijndel m...@mortis.eu wrote:
I'd rather not use assert(false) as on some systems assert() is used to
produce a nice GUI message. E.g. on Windows you'll get a message like
assertion $expression failed, abort, ignore, attach debugger?.
Deciding which
On Thu, Jan 29, 2009 at 08:49:39PM +0100, Per Inge Mathisen wrote:
I want to define a new macro ASSERT_RETURN(expr, retval, ...) that
asserts in debug builds, and returns with the given return value in
non-debug builds. This to make it easier to do the right thing when
coding, which is to
On 1/31/09, Per Inge Mathisen per.mathi...@gmail.com wrote:
On Sat, Jan 31, 2009 at 7:43 AM, bugs buggy buginato...@gmail.com wrote:
I was thinking we may do something like a ASSERT_ENTER() as well
How would it work?
It wouldn't work in all functions, just functions that have a known
On Sat, Jan 31, 2009 at 4:05 PM, Giel van Schijndel m...@mortis.eu wrote:
I like the general idea. About your patch, assert() itself performs
string expansion on the given expression as well (for display purposes).
Doesn't caching the expression's result cause assert() to see another
string,
On 1/29/09, Per Inge Mathisen per.mathi...@gmail.com wrote:
I want to define a new macro ASSERT_RETURN(expr, retval, ...) that
asserts in debug builds, and returns with the given return value in
non-debug builds. This to make it easier to do the right thing when
coding, which is to first
I want to define a new macro ASSERT_RETURN(expr, retval, ...) that
asserts in debug builds, and returns with the given return value in
non-debug builds. This to make it easier to do the right thing when
coding, which is to first check an entry condition with an assert, and
then check it again to