1
# DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++.
3
Index: b/src/gcc/doc/invoke.texi
4
===================================================================
5
--- a/src/gcc/doc/invoke.texi
6
+++ b/src/gcc/doc/invoke.texi
8
in future warnings may be added to @option{-Wformat-security} that are not
9
included in @option{-Wformat-nonliteral}.)
11
+NOTE: In Ubuntu 8.10 and later versions this option is enabled by default
12
+for C, C++, ObjC, ObjC++. To disable, use @option{-Wno-format-security},
13
+or disable all format warnings with @option{-Wformat=0}. To make format
14
+security warnings fatal, specify @option{-Werror=format-security}.
18
@opindex Wno-format-y2k
22
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
25
+/* no separate spec, just shove it into the ssp default spec */
26
+#define FORMAT_SECURITY_SPEC "%{!Wno-format-security:%{!Wformat|!Wformat=2|!Wall:-Wformat} -Wformat-security}"
28
#ifndef SSP_DEFAULT_SPEC
29
#ifdef TARGET_LIBC_PROVIDES_SSP
30
-#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:-fstack-protector}}}}"
31
+#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:-fstack-protector}}}} " FORMAT_SECURITY_SPEC
33
-#define SSP_DEFAULT_SPEC ""
34
+#define SSP_DEFAULT_SPEC FORMAT_SECURITY_SPEC