Re: Simplifying our Trap/Assert infrastructure - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Simplifying our Trap/Assert infrastructure
Date
Msg-id 20221009210148.GA900071@nathanxps13
Whole thread Raw
In response to Simplifying our Trap/Assert infrastructure  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Simplifying our Trap/Assert infrastructure
Re: Simplifying our Trap/Assert infrastructure
List pgsql-hackers
On Sun, Oct 09, 2022 at 03:51:57PM -0400, Tom Lane wrote:
> I happened to notice that the Trap and TrapMacro macros defined in c.h
> have a grand total of one usage apiece across our entire code base.
> It seems a little pointless and confusing to have them at all, since
> they're essentially Assert/AssertMacro but with the inverse condition
> polarity.  I'm also annoyed that they are documented while the macros
> we actually use are not.

+1, I noticed this recently, too.

> Hence, I propose the attached.

The patch LGTM.  It might be worth removing usages of AssertArg and
AssertState, too, but that can always be done separately.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Simplifying our Trap/Assert infrastructure
Next
From: Tom Lane
Date:
Subject: Re: Simplifying our Trap/Assert infrastructure