Re: Assert for frontend programs? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Assert for frontend programs?
Date
Msg-id 1570.1355502793@sss.pgh.pa.us
Whole thread Raw
In response to Re: Assert for frontend programs?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Assert for frontend programs?
Re: Assert for frontend programs?
Re: Assert for frontend programs?
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 14.12.2012 17:54, Tom Lane wrote:
>> BTW, I think psql already has a "psql_assert".

> psql_assert looks like this:

> #ifdef USE_ASSERT_CHECKING
> #include <assert.h>
> #define psql_assert(p) assert(p)
> #else
> ...

> On my Linux system, a failure looks like this:

> ~$ ./a.out
> a.out: a.c:5: main: Assertion `1==2' failed.
> Aborted

> That seems fine to me.

Works for me.  So just rename that to Assert() and move it into
postgres-fe.h?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Mikko Tiihonen
Date:
Subject: Re: Use gcc built-in atomic inc/dec in lock.c
Next
From: Andrew Dunstan
Date:
Subject: Re: Assert for frontend programs?