Assert for frontend programs? - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Assert for frontend programs?
Date
Msg-id 50CB4553.9090407@dunslane.net
Whole thread Raw
Responses Re: Assert for frontend programs?
List 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



pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Re: Multiple --table options for other commands
Next
From: Mikko Tiihonen
Date:
Subject: Re: Use gcc built-in atomic inc/dec in lock.c