Re: Add support for __attribute__((returns_nonnull))

Поиск
Список
Период
Сортировка
Искать
От
Michael Paquier
Тема
Re: Add support for __attribute__((returns_nonnull))
Дата
Msg-id
ZZyP8rJOzcn0C-LY@paquier.xyz
Ответ на
Список
Дерево обсуждения
Add support for __attribute__((returns_nonnull)) "Tristan Partin" <tristan@neon.tech>
Re: Add support for __attribute__((returns_nonnull)) Peter Eisentraut <peter@eisentraut.org>
Re: Add support for __attribute__((returns_nonnull)) "Tristan Partin" <tristan@neon.tech>
Re: Add support for __attribute__((returns_nonnull)) John Naylor <johncnaylorls@gmail.com>
Re: Add support for __attribute__((returns_nonnull)) "Tristan Partin" <tristan@neon.tech>
Re: Add support for __attribute__((returns_nonnull)) Michael Paquier <michael@paquier.xyz>
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
Дата:
От: Michael Paquier
Дата:
FAQ