Re: Don't cast away const where possible - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Don't cast away const where possible
Date
Msg-id aZ3S7b++9As/yLez@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Don't cast away const where possible  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
Hi,

On Tue, Feb 24, 2026 at 05:05:34PM +0100, Peter Eisentraut wrote:
> On 23.02.26 12:22, Bertrand Drouvot wrote:
> > I can see a "volatile" one though:
> > 
> > vacuum.c:1885:46: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
> > 
> > worth to "fix" like in the attached while at it? (It's not really a fix as it
> > moves the warning from vacuum.c to c.h, but that's consistent with 481018f2804).
> 
> That fix looks correct.

Thanks for looking at it!

> But my patch says it's making changes only without
> use unconstify and the like.
> To fix all -Wcast-qual warnings, you'd need
> more changes like that, which I'm not currently proposing.

That's the only one "cast discards ‘volatile'" remaining outside c.h, that's
why I proposed a dedicated patch for it in passing. I'll open a dedicated thread
for the remaining volatile one.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Induja Sreekanthan
Date:
Subject: BUG: ReadStream look-ahead exhausts local buffers when effective_io_concurrency>=64
Next
From: Fujii Masao
Date:
Subject: Re: Fix bug of clearing of waitStart in ProcWakeup()