Re: [AD] al_assert

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I think al_assert is misnamed, it should be something like
al_report_and_abort - as you say, when that function is called, the
assertion has already been tested and failed. I'm happy with the
ASSERT macro and with the aborting part of al_assert, it's just the
reporting bit. I could write an OS X version  but what about the
others, is
   fprintt(stderr, ...);
   abort();
sufficient?

Pete

On Thu, Apr 16, 2009 at 11:43 PM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2009-04-16, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
>> Hmm. I'm not sure what it should actually do - isn't it platform
>> dependent? On OSX there's an equivalent function NSAssert which raises
>> an exception if it's triggered, but what is the equivalent on other
>> platforms?
>
> abort()?
>
> Apparently you should be using NSCAssert inside C functions.  However, I
> see that it's an equivalent of the assert() macro so it takes a condition
> argument, but by the time we're in al_assert() we know the condition has
> failed.
>
>> Pete
>>
>> On Thu, Apr 16, 2009 at 12:04 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
>> > On 2009-04-15, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
>> >> I added a patch to the tracker, it adds a new AL_FUNC_NORETURN macro
>> >> (in case there are any other functions we want to mark) I haven't
>> >> tested with MSVC. Unfortunately it now complains that al_assert can
>> >> return (which it can) - could we clear that up too?
>> >
>> > Yes, get rid of the register_assert_handler() stuff.
>> >
>> > Not sure about register_trace_handler.
>> >
>> > Peter
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers
>




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/