agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Subject: [PATCH v1] gin: change remaining StaticAssertStmt() to StaticAssertDecl()
Date: Thu, 9 Apr 2026 11:10:33 +0000

d50c86e74375 added a comment mentioning that StaticAssertStmt is deprecated
but 6f5ad00ab763 made use of it.

Fixing by replacing the StaticAssertStmt() by StaticAssertDecl() at file scope.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
---
 src/backend/access/gin/ginutil.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 100.0% src/backend/access/gin/

diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c
index d3351fbe8a3..45d1a8fac9f 100644
--- a/src/backend/access/gin/ginutil.c
+++ b/src/backend/access/gin/ginutil.c
@@ -30,6 +30,8 @@
 #include "utils/typcache.h"
 #include "lib/qunique.h"
 
+/* GIN_CAT_NORM_KEY must be equal to 0 */
+StaticAssertDecl(GIN_CAT_NORM_KEY == 0, "Assuming GIN_CAT_NORM_KEY=0");
 
 /*
  * GIN handler function: return IndexAmRoutine with access method parameters
@@ -534,7 +536,6 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum,
 	/*
 	 * Create GinNullCategory representation.
 	 */
-	StaticAssertStmt(GIN_CAT_NORM_KEY == 0, "Assuming GIN_CAT_NORM_KEY=0");
 	categories = palloc0_array(GinNullCategory, nentries + (hasNull ? 1 : 0));
 
 	/* Put back a NULL entry, if there were any */
-- 
2.34.1


--U4l+Id+MMy3m7jIo--





view thread (132+ messages)  latest in thread

Message-ID: <no-message-id-1681888@localhost>
Permalink:  ../no-message-id-1681888@localhost/
Also on:    postgresql.org/message-id/no-message-id-1681888@localhost

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com
  Subject: Re: [PATCH v1] gin: change remaining StaticAssertStmt() to StaticAssertDecl()
  In-Reply-To: <no-message-id-1681888@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox