Re: Fix most -Wundef warnings

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix most -Wundef warnings
Date: 2019-10-14 15:12:29
Message-ID: df0e869c-3b51-c53e-6fb9-7a008c2329e1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/13/19 12:25 PM, Peter Eisentraut wrote:
> diff --git a/contrib/hstore/hstore_compat.c b/contrib/hstore/hstore_compat.c
> index 1d4e7484e4..d75e9cb23f 100644
> --- a/contrib/hstore/hstore_compat.c
> +++ b/contrib/hstore/hstore_compat.c
> @@ -299,7 +299,7 @@ hstoreUpgrade(Datum orig)
>
> if (valid_new)
> {
> -#if HSTORE_IS_HSTORE_NEW
> +#ifdef HSTORE_IS_HSTORE_NEW
> elog(WARNING, "ambiguous hstore value resolved as hstore-new");

Checking the current sources, git history, and various older commits, I
did not find where HSTORE_IS_HSTORE_NEW was ever defined. I expect it
was defined at some point, but I checked back as far as 9.0 (where the
current contrib/hstore was originally committed) and did not see it.
Where did you find this, and can we add a code comment? This one #ifdef
is the only line in the entire repository where this label is used,
making it hard to check if changing from #if was the right decision.

The check on HSTORE_IS_HSTORE_NEW goes back at least as far as 2006,
suggesting it was needed for migrating from some version pre-9.0, making
me wonder if anybody would need this in the field. Should we drop
support for this? I don't have a strong reason to advocate dropping
support other than that this #define appears to be undocumented.

mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-10-14 15:50:31 Re: stress test for parallel workers
Previous Message Tom Lane 2019-10-14 14:54:36 Re: v12.0: ERROR: could not find pathkey item to sort