Fix for compiler warning triggered in WinGetFuncArgInPartition()

From: Greg Burd <greg(at)burd(dot)me>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix for compiler warning triggered in WinGetFuncArgInPartition()
Date: 2025-10-09 14:21:23
Message-ID: DCA6DAC2-482A-476F-A027-8758524709E3@greg.burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

This is a minor change that avoids a "maybe uninitialized" warning that
I've been seeing since:

25a30bbd423 Add IGNORE NULLS/RESPECT NULLS option to Window functions.
src/backend/postgres_lib.a.p/executor_nodeWindowAgg.c.o../src/backend/executor/nodeWindowAgg.c:
In function
‘WinGetFuncArgInPartition’:../src/backend/executor/nodeWindowAgg.c:3809:33:
warning:‘notnull_relpos’ may be used uninitialized
[-Wmaybe-uninitialized] 3809 | } while (notnull_offset <
notnull_relpos); |
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~../src/backend/executor/nodeWindowAgg.c:3723:33:
note: ‘notnull_relpos’was declared here 3723 | int
notnull_relpos; | ^~~~~~~~~~~~~~

To calm the compiler's nerves this patch moves the initialization of
notnull_relpos to later in the function.

best.

-greg

Attachment Content-Type Size
v1-0001-Minor-fix-to-avoid-maybe-uninitialized-warning-re.patch application/octet-stream 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-10-09 14:30:06 Re: Fix overflow of nbatch
Previous Message Melanie Plageman 2025-10-09 14:16:21 Re: Fix overflow of nbatch