~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/d5/d55470df9952e71299d53e7db666c683d74d0e45.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Turn on -Wformat -Wformat-security by  default for C, C++, ObjC, ObjC++.
 
2
 
 
3
Index: b/src/gcc/doc/invoke.texi
 
4
===================================================================
 
5
--- a/src/gcc/doc/invoke.texi
 
6
+++ b/src/gcc/doc/invoke.texi
 
7
@@ -3351,6 +3351,11 @@
 
8
 in future warnings may be added to @option{-Wformat-security} that are not
 
9
 included in @option{-Wformat-nonliteral}.)
 
10
 
 
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}.
 
15
+
 
16
 @item -Wformat-y2k
 
17
 @opindex Wformat-y2k
 
18
 @opindex Wno-format-y2k
 
19
--- a/src/gcc/gcc.c
 
20
+++ b/src/gcc/gcc.c
 
21
@@ -654,11 +654,14 @@
 
22
 #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
 
23
 #endif
 
24
 
 
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}"
 
27
+
 
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
 
32
 #else
 
33
-#define SSP_DEFAULT_SPEC ""
 
34
+#define SSP_DEFAULT_SPEC FORMAT_SECURITY_SPEC
 
35
 #endif
 
36
 #endif
 
37