Re: [HACKERS] compiler warning in set_tablefunc_size_estimates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] compiler warning in set_tablefunc_size_estimates
Date
Msg-id 25755.1489095582@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] compiler warning in set_tablefunc_size_estimates  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] compiler warning in set_tablefunc_size_estimates  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I tried a non-cassert compile on a machine that has a pickier compiler
> than my laptop, and got:

> costsize.c: In function ‘set_tablefunc_size_estimates’:
> costsize.c:4574:17: error: variable ‘rte’ set but not used
> [-Werror=unused-but-set-variable]

> That appears to be a legitimate gripe.  Perhaps:

I think PG_USED_FOR_ASSERTS_ONLY would be a better solution.  It's
only happenstance that the function currently uses the RTE just
for this; if it grows another use, your approach would be harder
to clean up.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] exposing wait events for non-backends (was: Tracking wait event for latches)
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] exposing wait events for non-backends (was: Trackingwait event for latches)