Re: Fix most -Wundef warnings

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: Fix most -Wundef warnings
Дата
Msg-id df0e869c-3b51-c53e-6fb9-7a008c2329e1@gmail.com
обсуждение исходный текст
Ответ на Fix most -Wundef warnings  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: Fix most -Wundef warnings  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: Fix most -Wundef warnings  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: v12.0: ERROR: could not find pathkey item to sort
Следующее
От: Tom Lane
Дата:
Сообщение: Re: stress test for parallel workers