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 <[email protected]> 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 signals. So I would prefer to keep the slight
>>> ambiguity in the name.
>>
>> Then do I read this wrong?
>>> Assert that returns given return value on failure in non-debug builds.
> 
> In debug builds you get both an assert and a return if the condition
> fails.  You may not always get to the return, but it is there for
> those cases where you ignore the abort signal.

Still, even in non-debug builds the expression is asserted to hold true,
the action taken on failure to assert is just different. For debug
builds it calls some implementation defined __assert_fail-like function.
On non-debug builds only an error is logged.

>> I'd say that's always equal to ASSERT_OR_RETURN
> 
> Maybe. Maybe not. But ASSERT_RETURN is what I find used elsewhere.
> According to google it is somewhat frequent (26k pages), while it
> gives me exactly 3 pages for either of ASSERT_OR_RETURN as
> ASSERT_AND_RETURN.

I'd rather base names for our functions and macros on legibility than on
statistics. To me ASSERT_RETURN could mean any of ASSERT_OR_RETURN and
ASSERT_AND_RETURN.

-- 
Giel

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to