On Sat, Aug 29, 2026 at 10:21 PM Marina Polyakova <[email protected]> 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
v1-0001-postgres_fdw-Fix-may-be-used-uninitialized-warnin.patch
Description: Binary data
