static assert cleanup - Mailing list pgsql-hackers

From Peter Eisentraut
Subject static assert cleanup
Date
Msg-id 941a04e7-dd6f-c0e4-8cdf-a33b3338cbda@enterprisedb.com
Whole thread Raw
Responses Re: static assert cleanup  (John Naylor <john.naylor@enterprisedb.com>)
Re: static assert cleanup  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
A number of static assertions could be moved to better places.

We first added StaticAssertStmt() in 2012, which required all static 
assertions to be inside function bodies.  We then added 
StaticAssertDecl() in 2020, which enabled static assertions on file 
level.  We have a number of calls that were stuck in not-really-related 
functions for this historical reason.  This patch set cleans that up.

0001-Update-static-assert-usage-comment.patch

This updates the usage information in c.h to be more current and precise.

0002-Move-array-size-related-static-assertions.patch

This moves some obviously poorly placed ones.

0003-Move-some-static-assertions-to-better-places.patch

This moves some that I thought were suboptimally placed but it could be 
debated or refined.

0004-Use-StaticAssertDecl-where-possible.patch

This just changes some StaticAssertStmt() to StaticAssertDecl() where 
appropriate.  It's optional.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Next
From: Masahiko Sawada
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply