Re: Assert for frontend programs?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert for frontend programs?
Date: 2012-12-14 16:33:13
Message-ID: 1570.1355502793@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnakangas(at)vmware(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-12-14 16:36:01 Re: Assert for frontend programs?
Previous Message Mikko Tiihonen 2012-12-14 16:29:58 Re: Use gcc built-in atomic inc/dec in lock.c