aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '14.2.0/gentoo/02_all_default-warn-format-security.patch')
-rw-r--r--14.2.0/gentoo/02_all_default-warn-format-security.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/14.2.0/gentoo/02_all_default-warn-format-security.patch b/14.2.0/gentoo/02_all_default-warn-format-security.patch
new file mode 100644
index 0000000..439d9d8
--- /dev/null
+++ b/14.2.0/gentoo/02_all_default-warn-format-security.patch
@@ -0,0 +1,21 @@
+Enable -Wformat and -Wformat-security by default.
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -770,7 +770,7 @@ Warn about function calls with format strings that write past the end
+ of the destination region.
+
+ Wformat-security
+-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+ Warn about possible security problems with format functions.
+
+ Wformat-signedness
+@@ -795,7 +795,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
+ Warn about zero-length formats.
+
+ Wformat=
+-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
+ Warn about printf/scanf/strftime/strfmon format string anomalies.
+
+ Wframe-address