Re: Add support for __attribute__((returns_nonnull)) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add support for __attribute__((returns_nonnull))
Date
Msg-id ZZyP8rJOzcn0C-LY@paquier.xyz
Whole thread Raw
In response to Re: Add support for __attribute__((returns_nonnull))  ("Tristan Partin" <tristan@neon.tech>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make psql ignore trailing semicolons in \sf, \ef, etc
Next
From: Michael Paquier
Date:
Subject: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows