static assert cleanup
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-12-09T07:46:58Z
Lists: pgsql-hackers
Attachments
- 0001-Update-static-assert-usage-comment.patch (text/plain) patch 0001
- 0002-Move-array-size-related-static-assertions.patch (text/plain) patch 0002
- 0003-Move-some-static-assertions-to-better-places.patch (text/plain) patch 0003
- 0004-Use-StaticAssertDecl-where-possible.patch (text/plain) patch 0004
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.
Commits
-
Static assertions cleanup
- 75f49221c222 16.0 landed
-
Rearrange some static assertions for consistency
- b18c2decd76e 16.0 landed