[oe] [meta-oe][PATCH] flashrom: Fix build with clang
Adrian Bunk
bunk at stusta.de
Mon Mar 16 08:02:39 UTC 2020
On Sun, Mar 15, 2020 at 05:06:54PM -0700, Khem Raj wrote:
>...
> +clang complains like below
> +
> +libflashrom.c:191:43: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion]
> + supported_boards[i].working = binfo[i].working;
> + ~ ~~~~~~~~~^~~~~~~
> +libflashrom.c:229:46: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion]
> + supported_chipsets[i].status = chipset[i].status;
Please patch out the -Werror instead.
>...
> +However these enums are exactly same so they can be typecasted
If they are the same, the correct fix would be to have only one enum.
>...
> +Upstream-Status: Pending
>...
> +- supported_boards[i].working = binfo[i].working;
> ++ supported_boards[i].working = (enum flashrom_test_state)binfo[i].working;
>...
Working around a compile warning by making the code worse is not
an improvement.
Even worse when this is an OE-only workaround.
cu
Adrian
More information about the Openembedded-devel
mailing list