Auto merge of #1300 - ThisIsNotOfficialCodeItsJustForks:t915-add-wformat-security.2, r=ebfull

Add -Wformat -Wformat-security

Closes #915. Supersedes #1267 (because of weird rebase/github/zkbot bug).
This commit is contained in:
zkbot 2016-08-30 22:31:48 +00:00
commit f9c02827d4
1 changed files with 2 additions and 0 deletions

View File

@ -412,6 +412,8 @@ if test x$use_glibc_compat != xno; then
fi
if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-Wformat],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wformat"],[AC_MSG_ERROR(Cannot enable -Wformat)])
AX_CHECK_COMPILE_FLAG([-Wformat-security],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wformat-security"],[AC_MSG_ERROR(Cannot enable -Wformat-security)],[-Wformat])
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"],[AC_MSG_ERROR(Cannot enable -Wstack-protector)])
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"],[AC_MSG_ERROR(Cannot enable -fstack-protector-all)])