Assert for frontend programs?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Assert for frontend programs?
Date: 2012-12-14 15:27:15
Message-ID: 50CB4553.9090407@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As I'm working through the parallel dump patch, I notice this in one of
the header files:

#ifdef USE_ASSERT_CHECKING
#define Assert(condition) \
if (!(condition)) \
{ \
write_msg(NULL, "Failed assertion in %s, line %d\n", \
__FILE__, __LINE__); \
abort();\
}
#else
#define Assert(condition)
#endif

I'm wondering if we should have something like this centrally (e.g. in
postgres_fe.h)? I can certainly see people wanting to be able to use
Assert in frontend programs generally, and it makes sense to me not to
make everyone roll their own.

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikko Tiihonen 2012-12-14 15:33:05 Re: Use gcc built-in atomic inc/dec in lock.c
Previous Message Karl O. Pinc 2012-12-14 15:14:14 Re: Multiple --table options for other commands