Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Dmitry Mityugov <d(dot)mityugov(at)postgrespro(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings
Date: 2025-07-15 23:30:21
Message-ID: CAH2-Wzk-LH8Ln235hB4Y39EDFE6Bvb2bxKxMn_Ru4GjJNxTHnA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 15, 2025 at 7:27 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> There are a lot of them, for sure.

It's *very* common for switch statements to have a "can't happen"
elog(ERROR) as their default block. Many of these default blocks also
initialize related variables to placate the compiler.

> I'd be a bit worried about
> creating a back-patching mine-field. But maybe these are all
> in spots we're unlikely to touch?

That seems like much less of a problem for a purely subtractive change
such as this.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-07-15 23:39:29 Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Previous Message Tom Lane 2025-07-15 23:27:18 Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings