[dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architercture

Bruce Richardson bruce.richardson at intel.com
Mon Nov 11 11:47:12 CET 2019


On Mon, Nov 11, 2019 at 06:34:20PM +0800, Phil Yang wrote:
> The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf
> architecture doesn't support the flag '-Wno-address-of-packed-member',
> so remove this flag for aarch32.
> 
> Fixes: a385972c3675 ("mk: disable warning for packed member pointer")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Phil Yang <phil.yang at arm.com>
> Reviewed-by: Gavin Hu <gavin.hu at arm.com>
> Tested-by: Joyce Kong <joyce.kong at arm.com>
> 
> ---
>  mk/toolchain/gcc/rte.vars.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index 9fc7041..ec0cbbf 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation
>  endif
>  
>  # disable packed member unalign warnings
> +ifneq ($(CONFIG_RTE_ARCH_ARM), y)
>  WERROR_FLAGS += -Wno-address-of-packed-member
> +endif
>  
You don't need to do this, as gcc will not complain about this unknown flag
unless you have other issues in your code.[1] I think it's better to keep the
code clean in this case, otherwise we'll have the code littered with
conditionals for various flags.

/Bruce

[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g.,
-Wunknown-warning), GCC emits a diagnostic stating that the option is not
recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unless other
diagnostics are being produced. This allows the use of new -Wno- options
with old compilers, but if something goes wrong, the compiler warns that an
unrecognized option is present."


More information about the dev mailing list