Re: Confused static assertion implementation

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-11-14T22:27:23Z
Lists: pgsql-hackers

Attachments

On Fri, Nov 14, 2025 at 6:18 PM Chao Li <li.evan.chao@gmail.com> wrote:
> As you added a semi-colon in the line, the one after the empty line can be deleted, though C allows empty statement, but unnecessary, and may lead to confusion for code readers.

> You missed to replace this pgac_cv__static_assert with the new name.

Ugh, yeah, the configure change was hopeless.  It looked like it
worked in configure's stdout, which I mistook for success and posted
too soon, sorry about that.  I have fixed those points and verified
that pg_config.h actually has the expected value.

Thanks for the review!

Commits

  1. Refactor static_assert() support.

  2. Replace most StaticAssertStmt() with StaticAssertDecl()

  3. Make <assert.h> consistently available in frontend and backend