Add support for __attribute__((returns_nonnull))

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Add support for __attribute__((returns_nonnull))
Date: 2023-12-19 20:43:49
Message-ID: CXSLPXNZVASK.7Y7JSMC2FTK9@neon.tech
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch which adds support for the returns_nonnull attribute
alongside all the other attributes we optionally support.

I recently wound up in a situation where I was checking for NULL return
values of a function that couldn't ever return NULL because the
inability to allocate memory was always elog(ERROR)ed (aborted).

I didn't go through and mark anything, but I feel like it could be
useful for people going forward, including myself.

--
Tristan Partin
Neon (https://neon.tech)

Attachment Content-Type Size
v1-0001-Add-support-for-__attribute__-returns_nonnull.patch text/x-patch 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-12-19 20:59:03 Re: Built-in CTYPE provider
Previous Message Robert Haas 2023-12-19 20:36:03 Re: trying again to get incremental backup