Fix accidentally cast away qualifiers

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix accidentally cast away qualifiers
Date: 2026-01-20 07:54:18
Message-ID: b04f4d3a-5e70-4e73-9ef2-87f777ca4aac@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
0001-Fix-accidentally-cast-away-qualifiers.patch text/plain 36.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-01-20 08:16:26 Re: Fix accidentally cast away qualifiers
Previous Message John Naylor 2026-01-20 07:48:03 Re: Undefined behavior detected by new clang's ubsan