pg_plan_advice: rtekind uninitialized compilation waning

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_plan_advice: rtekind uninitialized compilation waning
Date: 2026-03-12 20:16:29
Message-ID: CAA5RZ0sieVNfniCKMDdDjuXGd1OuzMQfTS5=9vX3sa-iiujKUA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I just noticed $SUBJECT due to 5883ff30b0

[1/2] Compiling C object
contrib/pg_plan_advice/pg_plan_advice.so.p/pgpa_scan.c.o
In file included from ../src/include/postgres.h:49:0,
from ../contrib/pg_plan_advice/pgpa_scan.c:12:
../contrib/pg_plan_advice/pgpa_scan.c: In function ‘unique_nonjoin_rtekind’:
../src/include/utils/elog.h:241:18: warning: ‘rtekind’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
ereport(elevel, errmsg_internal(__VA_ARGS__))
^~~~~~~~~~~~~~~
../contrib/pg_plan_advice/pgpa_scan.c:246:11: note: ‘rtekind’ was declared here
RTEKind rtekind;
^~~~~~~

Attached initializes rtekind to RTE_RELATION to keep the compiler happy.
The value is set correctly inside the loop before it's used.

--
Sami Imseih
Amazon Web Services (AWS)

Attachment Content-Type Size
v1-0001-pg_plan_advice-Fix-compilation-waning.patch application/octet-stream 979 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2026-03-12 20:16:31 Re: Add starelid, attnum to pg_stats and leverage this in pg_dump
Previous Message Robert Haas 2026-03-12 20:05:32 Re: Better shared data structure management and resizable shared data structures