On Thu, Oct 26, 2023 at 4:59 PM Amit Langote <amitlangote09@gmail.com> wrote:
> On Thu, Oct 26, 2023 at 3:08 PM David Rowley <dgrowleyml@gmail.com> wrote:
> > On Thu, 26 Oct 2023 at 15:59, Amit Langote <amitlan@postgresql.org> wrote:
> > > src/backend/optimizer/util/inherit.c | 9 ++-------
> >
> > Hi Amit,
> >
> > I'm getting an unused variable warning from this with non-assert builds:
> >
> > [697/1908] Compiling C object
> > src/backend/postgres_lib.a.p/optimizer_util_inherit.c.o
> > ../src/backend/optimizer/util/inherit.c: In function
> > ‘expand_single_inheritance_child’:
> > ../src/backend/optimizer/util/inherit.c:460:33: warning: unused
> > variable ‘parentOID’ [-Wunused-variable]
> > 460 | Oid parentOID = RelationGetRelid(parentrel);
> > | ^~~~~~~~~
>
> Thanks for the heads up?
Oops, wasn't a question. :)
> > Maybe parentOID needs a PG_USED_FOR_ASSERTS_ONLY?
>
> Hmm, how about simply removing the variable?
Actually, using PG_USED_FOR_ASSERTS_ONLY seems fine. I will push a fix shortly.
--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com