From 205d914736fa27abe76f959a074c750f10aca432 Mon Sep 17 00:00:00 2001 From: martynas Date: Mon, 13 Jan 2014 01:44:31 +0000 Subject: [PATCH] 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. --- gnu/gcc/gcc/c.opt | 2 +- gnu/usr.bin/gcc/gcc/c-common.c | 2 +- 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. */ -- 2.20.1