Re: [PATCH 2/2] parse-options: use and require int pointer for OPT_CMDMODE
- From
Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
- Date
- Sep 19, 2023, 09:40 UTC
- Message-ID
- <ZQlspgfu7yDW0oTN@ugly>
- In-Reply-To
- <e6d8a291-03de-cfd3-3813-747fc2cad145@web.de>
On Sat, Sep 09, 2023 at 11:14:20PM +0200, René Scharfe wrote:
>Some uses of OPT_CMDMODE provide a pointer to an enum. It is >dereferenced as an int pointer in parse-options.c::get_value(). These >two types are incompatible, though >
s/are/may be/ - c.f. https://en.cppreference.com/w/c/language/enum
>-- the storage size of an enum can vary between platforms. >
here's a completely different perspective: this is merely a theoretical problem, right? gcc for example won't actually use non-ints unless -fshort-enums is supplied. so how about simply adding a (configure) test to ensure that there is actually no problem, and calling it a day?
regards