1
# DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++.
6
gcc/doc/invoke.texi | 8 ++++++++
7
3 files changed, 10 insertions(+), 2 deletions(-)
9
--- a/src/gcc/c-family/c-common.c
10
+++ b/src/gcc/c-family/c-common.c
12
/* Warn about format/argument anomalies in calls to formatted I/O functions
13
(*printf, *scanf, strftime, strfmon, etc.). */
18
/* C/ObjC language option variables. */
20
--- a/src/gcc/c-family/c.opt
21
+++ b/src/gcc/c-family/c.opt
23
Warn about format strings that contain NUL bytes
26
-C ObjC C++ ObjC++ Var(warn_format_security) Warning
27
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
28
Warn about possible security problems with format functions
31
--- a/src/gcc/doc/invoke.texi
32
+++ b/src/gcc/doc/invoke.texi
34
@option{-Wformat-nonliteral}, @option{-Wformat-security}, and
35
@option{-Wformat=2} are available, but are not included in @option{-Wall}.
37
+NOTE: In Ubuntu 8.10 and later versions this option is enabled by default
38
+for C, C++, ObjC, ObjC++. To disable, use @option{-Wformat=0}.
42
@opindex Wno-format-y2k
43
@@ -3155,6 +3158,11 @@
44
in future warnings may be added to @option{-Wformat-security} that are not
45
included in @option{-Wformat-nonliteral}.)
47
+NOTE: In Ubuntu 8.10 and later versions this option is enabled by default
48
+for C, C++, ObjC, ObjC++. To disable, use @option{-Wno-format-security},
49
+or disable all format warnings with @option{-Wformat=0}. To make format
50
+security warnings fatal, specify @option{-Werror=format-security}.