Re: [PATCH 2/2] parse-options: use and require int pointer for OPT_CMDMODE
- From
René Scharfe <l.s.r@web.de>
- Date
- Sep 11, 2023, 20:11 UTC
- Message-ID
- <15530a5f-8d06-24c9-bc2d-e313c895f477@web.de>
- In-Reply-To
- <ZP2X9roiaeEjzf24@ugly>
Am 10.09.23 um 12:18 schrieb Oswald Buddenhagen:
Show 5 quoted lines
> On Sat, Sep 09, 2023 at 11:14:20PM +0200, René Scharfe wrote: >> Convert the offending OPT_CMDMODE users and use the typed value_int >> point in the macro's definition to enforce that type for future ones. >> > that defeats -Wswitch[-enum], though.
True. Though I don't fully understand these warnings (why not then also warn about if without else?), but taking them away is a bit rude to those who care.
> the pedantically correct solution would be using setter callbacks.
Or to use an int to point to and then copy into a companion enum variable to after parsing, which would be my choice.
René