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-03-06 00:24:09
Message-ID: ME3P282MB316608ABA3F6E4D71A74C72EB6212@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 06 Mar 2024 at 01:53, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> wrote:
> On Tue, 5 Mar 2024 at 15:30, Japin Li <japinli(at)hotmail(dot)com> wrote:
>> There is a warning if remove it, so I keep it.
>>
>> /home/japin/Codes/postgres/build/../src/backend/executor/execExprInterp.c:118:33: warning: label ‘CASE_EEOP_LAST’ defined but not used [-Wunused-label]
>> 118 | #define EEO_CASE(name) CASE_##name:
>> | ^~~~~
>> /home/japin/Codes/postgres/build/../src/backend/executor/execExprInterp.c:1845:17: note: in expansion of macro ‘EEO_CASE’
>> 1845 | EEO_CASE(EEOP_LAST)
>> | ^~~~~~~~
>
> I think if you remove the EEO_CASE(EEOP_LAST) block the warning should
> go away. That block is clearly marked as unreachable, so it doesn't
> really serve a purpose.

Thanks! Fixed as you suggested. Please see v3 patch.

Attachment Content-Type Size
v3-0001-Use-C99-designated-initializer-syntax-for-dispatc.patch text/x-diff 10.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2024-03-06 00:50:18 Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan
Previous Message David Zhang 2024-03-06 00:12:06 Re: Proposal for implementing OCSP Stapling in PostgreSQL