[parted-devel] [PATCH] disk.in.h: Remove use of enums with #define

Colin Watson cjwatson at debian.org
Fri Aug 5 16:35:44 BST 2022


On Thu, Aug 04, 2022 at 01:17:29PM -0700, Brian C. Lane wrote:
> The preprocessor doesn't evaluate the enum, so it ends up being 0, which
> causes problems for library users like pyparted which try to use the _LAST
> value to conditionally include support for newer flags.
> 
> Instead just define the int that is the first and last entry in each enum.

Would it be perhaps worth having test cases to ensure that these
definitions match the symbolic values that they're supposed to match?  I
can imagine that the *_LAST_* ones in particular might quite easily
drift by mistake, especially if vendor patches add any entries to those
enums.

-- 
Colin Watson (he/him)                              [cjwatson at debian.org]



More information about the parted-devel mailing list