Re: compiler warning in set_tablefunc_size_estimates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: compiler warning in set_tablefunc_size_estimates
Date: 2017-03-09 21:39:42
Message-ID: 25755.1489095582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-03-09 21:41:51 Re: exposing wait events for non-backends (was: Tracking wait event for latches)
Previous Message Tom Lane 2017-03-09 21:37:29 Re: exposing wait events for non-backends (was: Tracking wait event for latches)