0001-Use-pg_assume-in-jsonb_util.c-to-fix-GCC-15-warning.patch
text/x-diff
Filename: 0001-Use-pg_assume-in-jsonb_util.c-to-fix-GCC-15-warning.patch
Type: text/x-diff
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch 0001
| File | + | − |
|---|---|---|
| src/backend/utils/adt/jsonb_util.c | 2 | 2 |
From: Dmitry Mityugov <d.mityugov@postgrespro.ru> Date: Thu, 10 Jul 2025 22:05:12 +0300 Subject: Use pg_assume in jsonb_util.c to fix GCC 15 warnings Recently introduced pg_assume macro is a great tool to silence GCC 15 warnings generated for release builds, when Assert() macro is disabled. This patch fixes two of them in backend/utils/adt/jsonb_util.c module. --- src/backend/utils/adt/jsonb_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c index c18bf741521..2478346ce19 100644 --- a/src/backend/utils/adt/jsonb_util.c +++ b/src/backend/utils/adt/jsonb_util.c @@ -291,8 +291,8 @@ compareJsonbContainers(JsonbContainer *a, JsonbContainer *b) * WJB_BEGIN_ARRAY and WJB_BEGIN_OBJECT tokens first, and * concluded that they don't match. */ - Assert(ra != WJB_END_ARRAY && ra != WJB_END_OBJECT); - Assert(rb != WJB_END_ARRAY && rb != WJB_END_OBJECT); + pg_assume(ra != WJB_END_ARRAY && ra != WJB_END_OBJECT); + pg_assume(rb != WJB_END_ARRAY && rb != WJB_END_OBJECT); Assert(va.type != vb.type); Assert(va.type != jbvBinary); -- 2.50.1