Skip to content

Commit

Permalink
tests: Disable no-format-truncation warnings
Browse files Browse the repository at this point in the history
test_snprintf function (tests/test-util.c) tests snprintf with shorter length,
but this emit a warning on GCC 7.0 or later.

This commit disables that warning on tests only.

Signed-off-by: Timothy Redaelli <[email protected]>
Acked-by: Lance Richardson <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
drizzt authored and russellb committed Jul 15, 2017
1 parent 8bdb2bd commit dd95bb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ OVS_ENABLE_OPTION([-Wduplicated-cond])
OVS_ENABLE_OPTION([-Qunused-arguments])
OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
OVS_CONDITIONAL_CC_OPTION([-Wno-format-truncation], [HAVE_WNO_FORMAT_TRUNCATION])
OVS_ENABLE_WERROR
OVS_ENABLE_SPARSE
OVS_CTAGS_IDENTIFIERS
Expand Down
5 changes: 5 additions & 0 deletions tests/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ tests_ovstest_SOURCES += \
endif

tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la
tests_ovstest_CFLAGS = $(AM_CFLAGS)
if HAVE_WNO_FORMAT_TRUNCATION
tests_ovstest_CFLAGS += -Wno-format-truncation
endif

dist_check_SCRIPTS = tests/flowgen.pl

noinst_PROGRAMS += tests/test-strtok_r
Expand Down

0 comments on commit dd95bb5

Please sign in to comment.