pgsql: Add pg_nodiscard function declaration specifier

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add pg_nodiscard function declaration specifier
Date: 2020-11-11 10:07:11
Message-ID: E1kcn1z-0001VT-Oy@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add pg_nodiscard function declaration specifier

pg_nodiscard means the compiler should warn if the result of a
function call is ignored. The name "nodiscard" is chosen in alignment
with (possibly future) C and C++ standards. It maps to the GCC
attribute warn_unused_result.

Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://www.postgresql.org/message-id/flat/e3753562-99cd-b65f-5aca-687dfd1ec2fc(at)2ndquadrant(dot)com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c617aea6acdd9057a14d91ff294905b1b5509348

Modified Files
--------------
src/include/c.h | 12 ++++++++++++
1 file changed, 12 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2020-11-11 15:25:38 Re: pgsql: Declare assorted array functions using anycompatible not anyelem
Previous Message Peter Eisentraut 2020-11-11 07:05:37 pgsql: Fix cases of discarding result from list API functions