summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2014-01-13 01:44:32 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2014-01-13 01:44:32 +0000
commit3cc5dac793f76d0a1dbcbd70fd5d9d64d2640ea7 (patch)
tree265dde3d1e7b70ab3243c1256ebcd37a14a97849
parent515d8341714401080a88ae062e14fe3a39993c2a (diff)
Enable Wbounded by default. Passing bound bigger than the buffer
size almost always has security implications. I think this quote from Theo summarizes the situation best: Which is why it is important to have at least one unforgiving platform in the ecosystem which properly labels shit shit. That's OpenBSD. If anyone can't handle that, they can go to platforms which hide the reality.
-rw-r--r--gnu/gcc/gcc/c.opt2
-rw-r--r--gnu/usr.bin/gcc/gcc/c-common.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gnu/gcc/gcc/c.opt b/gnu/gcc/gcc/c.opt
index 7d1bd41b10e..a0f37189b3a 100644
--- a/gnu/gcc/gcc/c.opt
+++ b/gnu/gcc/gcc/c.opt
@@ -133,7 +133,7 @@ C ObjC Var(warn_bad_function_cast)
Warn about casting functions to incompatible types
Wbounded
-C ObjC C++ Var(warn_bounded)
+C ObjC C++ Var(warn_bounded) Init(1)
Warn about basic buffer size problems
Wc++-compat
diff --git a/gnu/usr.bin/gcc/gcc/c-common.c b/gnu/usr.bin/gcc/gcc/c-common.c
index f850942c9f9..8abe97eb34a 100644
--- a/gnu/usr.bin/gcc/gcc/c-common.c
+++ b/gnu/usr.bin/gcc/gcc/c-common.c
@@ -335,7 +335,7 @@ int warn_format_security;
/* Warn about buffer size mismatches. */
-int warn_bounded;
+int warn_bounded = 1;
/* C/ObjC language option variables. */