Re: BUG #19406: substring(text) fails on valid UTF-8 toasted value in PostgreSQL 15.16

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, ranvis(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19406: substring(text) fails on valid UTF-8 toasted value in PostgreSQL 15.16
Date: 2026-02-16 18:21:45
Message-ID: 1157953.1771266105@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Noah Misch <noah(at)leadboat(dot)com> writes:
> Pushed as commit 9f4fd11

Various BF animals are complaining

varlena.c: In function 'text_substring':
varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
int32 E; /* end position, exclusive */
^

and I've also seen that locally depending on which gcc version and -O
level I'm using. Could we silence that?

bollworm | 2026-02-16 09:32:03 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
camel | 2026-02-16 09:32:30 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
chimaera | 2026-02-16 11:40:29 | /home/debian/20-chimaera/buildroot/HEAD/pgsql.build/../pgsql/src/backend/utils/adt/varlena.c:739:5: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
comma | 2026-02-16 14:55:48 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
conchuela | 2026-02-16 15:20:01 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
flea | 2026-02-16 09:31:52 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
krait | 2026-02-16 09:50:17 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
pipit | 2026-02-15 02:36:02 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
urocryon | 2026-02-15 01:45:07 | varlena.c:739:5: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
wireworm | 2026-02-16 15:20:49 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]
ziege | 2026-02-15 01:18:25 | varlena.c:590:9: warning: 'E' may be used uninitialized in this function [-Wmaybe-uninitialized]

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2026-02-16 20:19:32 Re: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.
Previous Message Tom Lane 2026-02-16 16:48:19 Re: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.