Bug 1359915 - Enable compile-time warnings for security-sensitive patterns. r=froydnj
authorNomis101 <Nomis101@web.de>
Thu, 01 Jun 2017 00:25:03 +0200
changeset 361757 aea06724da78381b79b399b6ca72aaf0d49a4cac
parent 361756 59fa62ee9d7537bf9dd5e75ef77a6561b396fd21
child 361758 86118b6e455a69325eff54fb8160bd28f113f0a9
push id31940
push usercbook@mozilla.com
push dateThu, 01 Jun 2017 11:51:11 +0000
treeherdermozilla-central@0bcea6bac179 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1359915
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359915 - Enable compile-time warnings for security-sensitive patterns. r=froydnj
build/moz.configure/warnings.configure
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -107,11 +107,16 @@ check_and_add_gcc_warning('-Wformat')
 # We use mix of both POSIX and Win32 printf format across the tree, so format
 # warnings are useless on mingw.
 check_and_add_gcc_warning('-Wno-format',
                           when=depends(target)(lambda t: t.kernel == 'WINNT'))
 
 # We hit this all over the place with the gtest INSTANTIATE_TEST_CASE_P macro
 check_and_add_gcc_warning('-Wno-gnu-zero-variadic-macro-arguments')
 
+# Add compile-time warnings for unprotected functions and format functions
+# that represent possible security problems
+check_and_add_gcc_warning('-Wformat-security')
+check_and_add_gcc_warning('-Wformat-overflow=2')
+
 # Please keep these last in this file
 add_old_configure_assignment('_WARNINGS_CFLAGS', warnings_cflags)
 add_old_configure_assignment('_WARNINGS_CXXFLAGS', warnings_cxxflags)