[PATCH] Removes uninitialized variable compiler warning

From: Todd Sedano <tsedano(at)pivotal(dot)io>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Removes uninitialized variable compiler warning
Date: 2017-03-20 16:42:30
Message-ID: CAGqMwaCftcV25kOZn0rofD=rV7oPFzD-SdkSrS=KL1NdWmV8Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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;

Attachment Content-Type Size
lenlemm_remove_compiler_warning.patch application/octet-stream 462 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-03-20 16:46:55 Re: Patch: Write Amplification Reduction Method (WARM)
Previous Message Stephen Frost 2017-03-20 16:40:58 Re: pg_dump emits ALTER TABLE ONLY partitioned_table