Skip to content

Commit

Permalink
configure: Use -Wformat-security with -Wformat.
Browse files Browse the repository at this point in the history
GCC 6.1 warns that -Wformat-security has no effect without -Wformat, so
this commit fixes the problem.

The change to _OVS_CHECK_CC_OPTION is needed so that the cache variable
name doesn't end up with a space in it, which obviously doesn't work.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Andy Zhou <[email protected]>
  • Loading branch information
blp committed Dec 12, 2016
1 parent 37f4615 commit 726af75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl
m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-=], [__])])dnl
m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-= ], [__])])dnl
AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name],
[ovs_save_CFLAGS="$CFLAGS"
dnl Include -Werror in the compiler options, because without -Werror
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -147,7 +147,7 @@ OVS_ENABLE_OPTION([-Wall])
OVS_ENABLE_OPTION([-Wextra])
OVS_ENABLE_OPTION([-Wno-sign-compare])
OVS_ENABLE_OPTION([-Wpointer-arith])
OVS_ENABLE_OPTION([-Wformat-security])
OVS_ENABLE_OPTION([-Wformat -Wformat-security])
OVS_ENABLE_OPTION([-Wswitch-enum])
OVS_ENABLE_OPTION([-Wunused-parameter])
OVS_ENABLE_OPTION([-Wbad-function-cast])
Expand Down

0 comments on commit 726af75

Please sign in to comment.