| From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
|---|---|
| To: | Marina Polyakova <m(dot)polyakova(at)postgrespro(dot)ru> |
| Cc: | Karina Litskevich <litskevichkarina(at)gmail(dot)com>, Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>, Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, solaimurugan vellaipandiyan <drsolaimurugan(dot)v(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, g(dot)kashkin(at)postgrespro(dot)ru, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Function scan FDW pushdown |
| Date: | 2026-09-01 22:11:36 |
| Message-ID: | CAPpHfduE7MivD8SzpoDFrOahpqtc-UGpEpZ9BXmUGjL2XbFbcQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Sat, Aug 29, 2026 at 10:21 PM Marina Polyakova
<m(dot)polyakova(at)postgrespro(dot)ru> wrote:
> I got this warning with gcc-13 ([1], [2]) and CFLAGS=-Og (both -O0 and
> -O1 work fine). Both gcc-12 [3] and gcc-14 [4] work fine with
> CFLAGS=-Og. IMO this compiler warning is strange because the attached
> patch with a simple code reordering fixes it.
>
> [1] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-13.3.0
> [2] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-13.4.0
> [3] Ubuntu 12.3.0-1ubuntu1~22.04.3 12.3.0
> [4] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-14.4.0
>
> On 2026-08-28 16:18, Karina Litskevich wrote:
> > Hi!
> >
> > Here is another compilation warning that seems to be caused by this
> > patch.
> >
> > postgres_fdw.c: In function ‘foreign_join_ok’:
> > postgres_fdw.c:7135:46: error: ‘fpinfo_i’ may be used
> > uninitialized [-Werror=maybe-uninitialized]
> > 7135 | if (fpinfo_o->local_conds || fpinfo_i->local_conds)
> > | ~~~~~~~~^~~~~~~~~~~~~
> > postgres_fdw.c:7044:28: note: ‘fpinfo_i’ was declared here
> > 7044 | PgFdwRelationInfo *fpinfo_i;
> > | ^~~~~~~~
Yes, compiler may fail to trace invariants of
inner_is_function/outer_is_function flags usage. I suggest to remove
them altogether. See the attached patch. I think this code also
becomes a bit more readable.
------
Regards,
Alexander Korotkov
Supabase
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-postgres_fdw-Fix-may-be-used-uninitialized-warnin.patch | application/octet-stream | 5.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alexander Korotkov | 2026-09-01 22:17:17 | Re: Two issues leading to discrepancies in FSM data on the standby server |
| Previous Message | Zsolt Parragi | 2026-09-01 22:05:35 | Re: Routed ON CONFLICT inserts broken by partition-local deferrable unique constraints in 19 and master |