Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Dmitry Mityugov <d.mityugov@postgrespro.ru>, pgsql-hackers@postgresql.org
Date: 2025-07-15T22:35:01Z
Lists: pgsql-hackers
On Sat, Jul 12, 2025 at 1:55 PM Andres Freund <andres@anarazel.de> wrote: > I had played with using pg_assume here too, but I couldn't really convince > myself that it's a good idea... In the past, it was often necessary to work around MSVC's inability to see that a block containing elog(ERROR) doesn't actually need to initialize variables that'll never actually be used in code that comes after that block. We still have many "keep compiler quiet" variable initializations due to this. Is that still something that we need to worry about? I don't recall running into it in quite a few years, though that might just be a coincidence. It looks like MSVC uses __assume for this now, by way of elog/ereport's use of pg_unreachable. You also used __assume to implement pg_assume for MSVC. It seems reasonable to surmise that we can officially stop worrying about elog(ERROR) related warnings/to suppose that we no longer have to add "keep compiler quiet" variable initializations after an elog(ERROR). If it works for MSVC + pg_assume, then it ought to also work for MSVC + pg_unreachable. Right? -- Peter Geoghegan
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Clarify the ra != rb case in compareJsonbContainers().
- 2a3a3964328a 19 (unreleased) landed
-
Silence uninitialized-value warnings in compareJsonbContainers().
- f32e45641460 15.14 landed
- aad1617b76ae 19 (unreleased) landed
- 8254b7e33be9 14.19 landed
- 6c93bf735ce1 13.22 landed
- 5db55e13f210 16.10 landed
- 5a2139a90690 17.6 landed
- 0b6dfce0ce4d 18.0 landed