Re: A compiling warning in jsonb_populate_record_valid

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: A compiling warning in jsonb_populate_record_valid
Дата
Msg-id CA+HiwqFiViHW=j4f+z5Sb8e9L5h8+jBLvenjgUfQPPCt2Sr6nw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: A compiling warning in jsonb_populate_record_valid  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
On Thu, Jan 25, 2024 at 4:47 PM Richard Guo <guofenglinux@gmail.com> wrote:
> On Thu, Jan 25, 2024 at 2:28 PM Amit Langote <amitlangote09@gmail.com> wrote:
>>
>> On Thu, Jan 25, 2024 at 2:59 PM Richard Guo <guofenglinux@gmail.com> wrote:
>> > I came across a warning when building master (a044e61f1b) on old GCC
>> > (4.8.5).
>> >
>> > jsonfuncs.c: In function ‘jsonb_populate_record_valid’:
>> > ../../../../src/include/nodes/miscnodes.h:53:15: warning: the comparison will always evaluate as ‘true’ for the
addressof ‘escontext’ will never be NULL [-Waddress] 
>> >   ((escontext) != NULL && IsA(escontext, ErrorSaveContext) && \
>> >                ^
>> > jsonfuncs.c:2481:23: note: in expansion of macro ‘SOFT_ERROR_OCCURRED’
>> >   return BoolGetDatum(!SOFT_ERROR_OCCURRED(&escontext));
>> >
>> > This was introduced in commit 1edb3b491b, and can be observed on several
>> > systems in the buildfarm too, such as:
>> > https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=arowana&dt=2024-01-25%2004%3A54%3A38&stg=build
>>
>> Thanks for the report.
>>
>> Will apply the attached, which does this:
>>
>> -   return BoolGetDatum(!SOFT_ERROR_OCCURRED(&escontext));
>> +   return BoolGetDatum(!escontext.error_occurred);
>
> Looks good to me.

Thanks for checking, pushed.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Use of backup_label not noted in log
Следующее
От: Andrew Bille
Дата:
Сообщение: Re: cataloguing NOT NULL constraints