Wrong dead return value in jsonb_utils.c

From: Rikard Falkeborn <rikard(dot)falkeborn(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Wrong dead return value in jsonb_utils.c
Date: 2019-05-12 01:18:08
Message-ID: CADRDgG7mJnek6HNW13f+LF6V=6gag9PM+P7H5dnyWZAv49aBGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Returning -1 from a function with bool as return value is the same as
returning true. Now, the code is dead (since elog(ERROR, ...) does not
return) so it doesn't matter to the compiler, but changing to false is less
confusing for the programmer. Appologies if this is seen as unnecessary
churn.

The same code is present since 9.4, but perhaps it's not really worth
backporting since it is more of an aesthetic change?

Attachment Content-Type Size
0001-Fix-dead-code-return-value-in-jsonb_util.patch text/x-patch 913 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2019-05-12 01:56:15 Re: Augment every test postgresql.conf
Previous Message Alvaro Herrera 2019-05-11 22:28:00 Re: Bug in reindexdb's error reporting