Re: Simplifying our Trap/Assert infrastructure

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Simplifying our Trap/Assert infrastructure
Date: 2022-10-09 21:01:48
Message-ID: 20221009210148.GA900071@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-10-09 21:08:39 Re: Simplifying our Trap/Assert infrastructure
Previous Message Tom Lane 2022-10-09 19:51:57 Simplifying our Trap/Assert infrastructure