Re: rename and move AssertVariableIsOfType - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: rename and move AssertVariableIsOfType
Date
Msg-id 2b407510-c426-464b-ab48-fb2ba233df3d@eisentraut.org
Whole thread Raw
In response to Re: rename and move AssertVariableIsOfType  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: rename and move AssertVariableIsOfType
List pgsql-hackers
On 03.02.26 14:39, Bertrand Drouvot wrote:
> Yeah, I gave it a try and I did not choose the same place for all the files.
> 
> 1/ basebackup.c
> 
> Since changing the remaining StaticAssertStmt to StaticAssertDecl introduces
> a duplicate, I thought it would make sense to:
> 
> - remove the StaticAssertStmt
> - move the existing StaticAssertDecl at file scope
> 
> As it depends of the literal "2" also used in some computation then I introduced
> TAR_TERMINATION_BLOCKS and used it in the StaticAssertDecl and the functions.
> 
> 2/ deadlock.c
> 
> It makes sense to keep it near the related code, so:
> 
> - changed to StaticAssertDecl
> - Added new braces to avoid Wdeclaration-after-statement to trigger
> 
> 3/ aset.c
> 
> Changes the StaticAssertStmt to StaticAssertDecl and move it to file scope (that
> looks more appropriate).
> 
> Attached 3 patches to ease the review.
> 
> After there are no remaining usages of StaticAssertStmt() and we may want to
> deprecate it.

I have committed this.

I changed TAR_TERMINATION_BLOCKS to TAR_NUM_TERMINATION_BLOCKS for a 
little bit more clarity.  And then I added a comment in c.h that 
StaticAssertStmt() is deprecated.




pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Improve docs syntax checking and enable it in the meson build
Next
From: Tomas Vondra
Date:
Subject: Re: index prefetching