Re: Don't cast away const where possible

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Don't cast away const where possible
Date: 2026-02-24 16:05:34
Message-ID: 289cbc3c-5962-4d7a-b3e0-f7d4aef2639e@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-24 16:12:41 Re: Fix bug of clearing of waitStart in ProcWakeup()
Previous Message Peter Eisentraut 2026-02-24 16:02:07 Re: Check for memset_explicit() and explicit_memset()