pgsql: Fix cases of discarding result from list API functions

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix cases of discarding result from list API functions
Date: 2020-11-11 07:05:37
Message-ID: E1kckCH-0000TZ-GU@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix cases of discarding result from list API functions

Two cases violated list APIs by throwing away the return value. While
the code was technically correct, it relied on internal knowledge of
the list implementation, and the code wasn't really gaining anything
that way. It is planned to make this a compiler warning in the
future, so just fix these cases by assigning the return value
properly.

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/c77f6f50e4187bed38d1d36ae16b0c248e286d15

Modified Files
--------------
src/backend/commands/lockcmds.c | 2 +-
src/backend/parser/analyze.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-11 10:07:11 pgsql: Add pg_nodiscard function declaration specifier
Previous Message Tom Lane 2020-11-11 03:52:19 pgsql: Fix and simplify some usages of TimestampDifference().