Re: Improve readability by using designated initializers when possible

From: Japin Li <japinli(at)hotmail(dot)com>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve readability by using designated initializers when possible
Date: 2024-02-28 01:41:42
Message-ID: ME3P282MB3166DEAB9FAFA07C54CEF3EDB6582@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 28 Feb 2024 at 00:06, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> wrote:
> On Tue, 27 Feb 2024 at 16:04, Japin Li <japinli(at)hotmail(dot)com> wrote:
>> I see the config_group_names[] needs null-terminated because of help_config,
>> however, I didn't find the reference in help_config.c. Is this comment
>> outdated?
>
> Yeah, you're correct. That comment has been outdated for more than 20
> years. The commit that made it unnecessary to null-terminate the array
> was 9d77708d83ee.
>
> Attached is v5 of the patchset that also includes this change (with
> you listed as author).

Thanks for updating the patch!

It looks good to me except there is an outdated comment.

diff --git a/src/common/encnames.c b/src/common/encnames.c
index bd012fe3a0..dba6bd2c9e 100644
--- a/src/common/encnames.c
+++ b/src/common/encnames.c
@@ -297,7 +297,6 @@ static const pg_encname pg_encname_tbl[] =

/* ----------
* These are "official" encoding names.
- * XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h)
* ----------
*/
#ifndef WIN32

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2024-02-28 01:45:26 Re: Logging parallel worker draught
Previous Message Jeff Davis 2024-02-28 00:22:34 Re: MAINTAIN privilege -- what do we need to un-revert it?