[1/2] net/octeontx2: check compiler flag before use

Message ID 20200124153755.13939-2-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series remove compiler warnings with icc using meson |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/iol-testing success Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Bruce Richardson Jan. 24, 2020, 3:37 p.m. UTC
  Rather than assuming all compilers support the -flax-vector-extensions
flag, we should test this before using it, thereby potentially avoiding
warnings.

Cc: jerinj@marvell.com

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/octeontx2/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Jerin Jacob Jan. 28, 2020, 4:55 p.m. UTC | #1
On Fri, Jan 24, 2020 at 9:10 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Rather than assuming all compilers support the -flax-vector-extensions
> flag, we should test this before using it, thereby potentially avoiding
> warnings.
>
> Cc: jerinj@marvell.com
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  drivers/net/octeontx2/meson.build | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/octeontx2/meson.build b/drivers/net/octeontx2/meson.build
> index fad3076a3..bde19678f 100644
> --- a/drivers/net/octeontx2/meson.build
> +++ b/drivers/net/octeontx2/meson.build
> @@ -26,9 +26,7 @@ sources = files('otx2_rx.c',
>
>  deps += ['bus_pci', 'common_octeontx2', 'mempool_octeontx2']
>
> -cflags += ['-flax-vector-conversions']
> -
> -extra_flags = []
> +extra_flags = ['-flax-vector-conversions']
>  # This integrated controller runs only on a arm64 machine, remove 32bit warnings
>  if not dpdk_conf.get('RTE_ARCH_64')
>         extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast']
> --
> 2.20.1
>
  

Patch

diff --git a/drivers/net/octeontx2/meson.build b/drivers/net/octeontx2/meson.build
index fad3076a3..bde19678f 100644
--- a/drivers/net/octeontx2/meson.build
+++ b/drivers/net/octeontx2/meson.build
@@ -26,9 +26,7 @@  sources = files('otx2_rx.c',
 
 deps += ['bus_pci', 'common_octeontx2', 'mempool_octeontx2']
 
-cflags += ['-flax-vector-conversions']
-
-extra_flags = []
+extra_flags = ['-flax-vector-conversions']
 # This integrated controller runs only on a arm64 machine, remove 32bit warnings
 if not dpdk_conf.get('RTE_ARCH_64')
 	extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast']