Re: fix more casting away of qualifiers - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: fix more casting away of qualifiers
Date
Msg-id c76b72dd-5736-453a-b698-6968d42e4768@eisentraut.org
Whole thread
List pgsql-hackers
On 18.08.26 11:04, Peter Eisentraut wrote:
> The attached patches fix more cases where qualifiers (const, volatile) 
> are cast away either accidentally, or unnecessarily, or where it can be 
> worked around easily.
> 
> I split these into tiny bits to simplify review and to show that they 
> are all independent.  But they could perhaps be committed all together.
> (See also similar commit 3f988629805.)
> 
> I have a local WIP branch that fixes all remaining -Wcast-qual warnings. 
>   The attached patches are the "easy" half of that.  I plan to propose 
> addressing the other half separately later.

Here are more patches for this.  (I suppose this is half of the 
above-mentioned other half.)

The first two patches address the issue that unconstify cannot be used 
for global variables.  I'm introducing an unconstify_constexpr that can 
be used for that but only works for GCC.

The third patch adjusts unconstify, unconstify_constexpr, and unvolatize 
so that they don't trigger -Wcast-qual warnings.  This will be useful 
later when we have fixed all the remaining issues and we can turn on 
-Wcast-qual.

Patches 4 through 7 add various unconstify and unvolatize in place of or 
in addition to existing casts.

The last patch would then turn on the warning option, but it's only for 
illustration right, as there is more (increasingly complicated) stuff to 
fix after this.

Attachment

pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: Re: FIX: BUG #19687: ALTER SEQUENCE missing lock
Next
From: "Wei Sun"
Date:
Subject: Severe performance degradation with concurrent updates due to excessive EvalPlanQual (EPQ) re‑evaluation