[parted-devel] GCC unhappy with "case PED_EXCEPTION_OK_CANCEL:"

Brian C. Lane bcl at redhat.com
Tue Aug 10 18:06:59 BST 2021


On Sun, Jun 27, 2021 at 05:48:35PM -0400, D. Hugh Redelmeier wrote:
> I'm compiling fatresize.  It uses parted/exception.h
> 
> I get a warning from GCC:
> fatresize.c:319:9: warning: case value ‘96’ not in enumerated type 
> ‘PedExceptionOption’ [-Wswitch]
>   319 |         case PED_EXCEPTION_IGNORE_CANCEL:
>       |         ^~~~
> 
> The problem is that the case is on a value of type enum 
> _PedExceptionOption and PED_EXCEPTION_IGNORE_CANCEL is not a valid
> value of that enum type.
> 
> The fix is simple: just annex the #defines for combinations of options
> into the enum itself.  I don't see a downside.  UNTESTED.

On further reflection I agree, I'll push this today (note that it will
be against exception.in.h which is the source for exception.h)

Thanks,

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list