Re: Fix accidentally cast away qualifiers

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix accidentally cast away qualifiers
Date: 2026-01-20 08:16:26
Message-ID: 16F3FF82-6215-4318-9930-842926B3C693@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jan 20, 2026, at 15:54, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> This patch fixes cases where a qualifier (const, in all cases here) was dropped by a cast, but the cast was otherwise necessary or desirable, so the straightforward fix is to add the qualifier into the cast.
>
> This was checked with gcc -Wcast-qual, but it doesn't fix all such warnings, only the trivially fixable ones.<0001-Fix-accidentally-cast-away-qualifiers.patch>

Looks good to me. All changes are const-correctness fixes without semantic changes.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniil Davydov 2026-01-20 08:22:22 Re: Fix comments for buf_id field of BufferDesc structure
Previous Message Peter Eisentraut 2026-01-20 07:54:18 Fix accidentally cast away qualifiers