[dpdk-dev,2/2] fix building with clang-3.8.0 compiler
Commit Message
Latest clang compiler 3.8.0 on latest update of Ubuntu
creates a few more warnings on -Warray-bounds and extra
() around 'if' expressions.
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
---
app/test-pmd/Makefile | 3 +++
app/test/Makefile | 3 +++
drivers/net/bonding/Makefile | 4 ++++
drivers/net/fm10k/Makefile | 2 ++
drivers/net/i40e/Makefile | 2 ++
lib/librte_cmdline/Makefile | 6 ++++++
lib/librte_eal/linuxapp/eal/Makefile | 7 +++++++
7 files changed, 27 insertions(+)
Comments
On 6/26/16, 10:32 AM, "dev on behalf of Keith Wiles" <dev-bounces@dpdk.org on behalf of keith.wiles@intel.com> wrote:
>Latest clang compiler 3.8.0 on latest update of Ubuntu
>creates a few more warnings on -Warray-bounds and extra
>() around 'if' expressions.
>
>Signed-off-by: Keith Wiles <keith.wiles@intel.com>
>---
> app/test-pmd/Makefile | 3 +++
> app/test/Makefile | 3 +++
> drivers/net/bonding/Makefile | 4 ++++
> drivers/net/fm10k/Makefile | 2 ++
> drivers/net/i40e/Makefile | 2 ++
> lib/librte_cmdline/Makefile | 6 ++++++
> lib/librte_eal/linuxapp/eal/Makefile | 7 +++++++
> 7 files changed, 27 insertions(+)
>
self-nak: found another problem
@@ -59,6 +59,9 @@ SRCS-y += icmpecho.c
SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
CFLAGS_cmdline.o := -D_GNU_SOURCE
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline.o += -Wno-array-bounds
+endif
# this application needs libraries first
DEPDIRS-y += lib drivers
@@ -211,6 +211,9 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
endif
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_test_errno.o += -Wno-array-bounds
+CFLAGS_test_devargs.o += -Wno-array-bounds
endif
# this application needs libraries first
@@ -43,6 +43,10 @@ EXPORT_MAP := rte_eth_bond_version.map
LIBABIVER := 1
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_rte_eth_bond_args.o := -Wno-array-bounds
+endif
+
#
# all source are stored in SRCS-y
#
@@ -59,6 +59,8 @@ CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
CFLAGS_BASE_DRIVER += -Wno-unused-variable
CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
+CFLAGS_fm10k_ethdev.o := -Wno-array-bounds
+
else
#
# CFLAGS for gcc
@@ -60,6 +60,8 @@ CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
CFLAGS_BASE_DRIVER += -Wno-unused-variable
+
+CFLAGS_i40e_hmc.o += -Wno-tautological-compare
else
CFLAGS_BASE_DRIVER = -Wno-sign-compare
CFLAGS_BASE_DRIVER += -Wno-unused-value
@@ -40,6 +40,12 @@ EXPORT_MAP := rte_cmdline_version.map
LIBABIVER := 2
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline_cirbuf.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_rdline.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_parse_string.o:= -Wno-array-bounds
+endif
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
@@ -125,6 +125,13 @@ CFLAGS_eal_common_options.o := -D_GNU_SOURCE
CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_eal_alarm.o += -Wno-parentheses-equality
+CFLAGS_eal_common_options.o += -Wno-array-bounds
+CFLAGS_eal_pci.o += -Wno-parentheses-equality
+CFLAGS_eal_pci.o += -Wno-array-bounds
+endif
+
# workaround for a gcc bug with noreturn attribute
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)