Re: Add support for __attribute__((returns_nonnull))

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Add support for __attribute__((returns_nonnull))
Дата
Msg-id ZZyP8rJOzcn0C-LY@paquier.xyz
обсуждение исходный текст
Ответ на Re: Add support for __attribute__((returns_nonnull))  ("Tristan Partin" <tristan@neon.tech>)
Список pgsql-hackers
On Mon, Jan 08, 2024 at 05:04:58PM -0600, Tristan Partin wrote:
> The idea I had in mind initially was PGLC_localeconv(), but I couldn't
> prove that anything changed with the annotation added. The second patch
> in my previous email was attempt at deriving real-world benefit, but
> nothing I did seemed to change anything. Perhaps you can test it and see
> if anything changes for you.

There are a bunch of places in the tree where we return NULL just to
keep the compiler quiet, and where we should never return NULL, as in:
    return NULL; /* keep compiler quiet */

See bbstreamer_gzip.c as one example for non-gzip builds.  Perhaps you
could look at one of these places and see if the marker shows
benefits?
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Make psql ignore trailing semicolons in \sf, \ef, etc
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows