@@ -57,8 +57,7 @@ add_project_arguments('-include', 'rte_config.h', language: 'c')
warning_flags = [
'-Wsign-compare',
'-Wcast-qual',
- '-Wno-address-of-packed-member',
- '-Wno-format-truncation'
+ '-Wno-address-of-packed-member'
]
foreach arg: warning_flags
if cc.has_argument(arg)
@@ -32,6 +32,9 @@ foreach class:driver_classes
sources = []
objs = []
cflags = machine_args
+ if cc.has_argument('-Wno-format-truncation')
+ cflags += '-Wno-format-truncation'
+ endif
includes = [include_directories(drv_path)]
# set up internal deps. Drivers can append/override as necessary
deps = std_deps
@@ -24,6 +24,10 @@ foreach example: examples
sources = []
allow_experimental_apis = false
cflags = machine_args
+ if cc.has_argument('-Wno-format-truncation')
+ cflags += '-Wno-format-truncation'
+ endif
+
ext_deps = [execinfo]
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
@@ -34,6 +34,10 @@ foreach l:libraries
headers = []
includes = []
cflags = machine_args
+ if cc.has_argument('-Wno-format-truncation')
+ cflags += '-Wno-format-truncation'
+ endif
+
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
@@ -235,6 +235,11 @@ if dpdk_conf.has('RTE_LIBRTE_KNI')
test_deps += 'kni'
endif
+cflags = machine_args
+if cc.has_argument('-Wno-format-truncation')
+ cflags += '-Wno-format-truncation'
+endif
+
test_dep_objs = []
compress_test_dep = dependency('zlib', required: false)
if compress_test_dep.found()
@@ -260,7 +265,7 @@ if get_option('tests')
test_sources,
link_whole: link_libs,
dependencies: test_dep_objs,
- c_args: [machine_args, '-DALLOW_EXPERIMENTAL_API'],
+ c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
install_rpath: driver_install_path,
install: false)