[PATCH 19.11 v2 2/3] net/ice: build failure with make and clang 13

Christian Ehrhardt christian.ehrhardt at canonical.com
Wed Dec 15 14:37:20 CET 2021


On Wed, Dec 15, 2021 at 2:08 AM Haiyue Wang <haiyue.wang at intel.com> wrote:
>
> Disable the -Wunused-but-set-variable option for clang to avoid
> compile warning.

Agreed, as I explained on patch 3/3 this is not an issue for upstream
as meson builds already set that flag.

$ grep -Hrn -C 3 -- no-unused-but-set-variable  | grep ice
drivers/net/ice/base/meson.build-14-]
drivers/net/ice/base/meson.build-15-
drivers/net/ice/base/meson.build-16-error_cflags = ['-Wno-unused-value',
drivers/net/ice/base/meson.build:17: '-Wno-unused-but-set-variable',
drivers/net/ice/base/meson.build-18- '-Wno-unused-variable',
drivers/net/ice/base/meson.build-19- '-Wno-unused-parameter',
drivers/net/ice/base/meson.build-20-]
drivers/net/ice/Makefile-31-CFLAGS_BASE_DRIVER += -Wno-unused-variable
drivers/net/ice/Makefile-32-
drivers/net/ice/Makefile-33-ifeq ($(shell test $(GCC_VERSION) -ge 44
&& echo 1), 1)
drivers/net/ice/Makefile:34:CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
drivers/net/ice/Makefile-35-endif
drivers/net/ice/Makefile-36-
drivers/net/ice/Makefile-37-endif

The resulting makefile will now set it in gcc newer than 4.4 and
globally on clang.
That is ok as older gcc's would fail due to the unknown option.

Applying to 19.11 LTS branch ...

> Bugzilla ID: 902
>
> Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
> ---
>  drivers/net/ice/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile
> index 6c4d155268..370b33af60 100644
> --- a/drivers/net/ice/Makefile
> +++ b/drivers/net/ice/Makefile
> @@ -26,6 +26,7 @@ CFLAGS_BASE_DRIVER +=
>  else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
>  CFLAGS_BASE_DRIVER += -Wno-unused-parameter
>  CFLAGS_BASE_DRIVER += -Wno-unused-variable
> +CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
>  else
>  CFLAGS_BASE_DRIVER += -Wno-unused-parameter
>  CFLAGS_BASE_DRIVER += -Wno-unused-variable
> --
> 2.34.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd


More information about the stable mailing list