[PATCH] Removes uninitialized variable compiler warning
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t36286psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 07:46 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t36286_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t36286_1 && git checkout t36286_1Patchset v1 (message #1) is on t36286_1
This patch removes a compiler warning.
warning: variable 'lenlemm' is uninitialized when used here
[-Wuninitialized]
This is my first commit to postgres. I've read through
http://wiki.postgresql.org/wiki/Submitting_a_Patch, but I may have missed
something.
diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c
index b612fb0e2c..3d66b2babd 100644
--- a/src/backend/tsearch/ts_parse.c
+++ b/src/backend/tsearch/ts_parse.c
@@ -357,8 +357,8 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
void
parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen)
{
- int type,
- lenlemm;
+ int type;
+ int lenlemm = 0;
char *lemm = NULL;
LexizeData ldata;
TSLexeme *norms;
Todd Sedano <tsedano@pivotal.io> writes:
This patch removes a compiler warning.
warning: variable 'lenlemm' is uninitialized when used here
[-Wuninitialized]
Hm, on what compiler? AFAICS, that parsetext() function hasn't
changed meaningfully since 2007, and nobody complained of
uninitialized-variable warnings in it before.
We're generally willing to try to silence such warnings on mainstream
compilers, but not on weird ones ...
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
We can disregard this patch. It appears that PointerGetDatum initializes
lenlemm.
On Mon, Mar 20, 2017 at 10:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Show quoted text
Todd Sedano <tsedano@pivotal.io> writes:
This patch removes a compiler warning.
warning: variable 'lenlemm' is uninitialized when used here
[-Wuninitialized]Hm, on what compiler? AFAICS, that parsetext() function hasn't
changed meaningfully since 2007, and nobody complained of
uninitialized-variable warnings in it before.We're generally willing to try to silence such warnings on mainstream
compilers, but not on weird ones ...regards, tom lane