diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-13 04:59:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-13 04:59:26 +0000 |
commit | 312531e36b7f7ba758d76da312951d21a49729e9 (patch) | |
tree | b90cd2ef61a03c76cce43627fdcf0446cf104b4f /4.5.4 | |
parent | stop enabling trampoline warnings by default in older versions for compatibil... (diff) | |
download | gcc-patches-312531e36b7f7ba758d76da312951d21a49729e9.tar.gz gcc-patches-312531e36b7f7ba758d76da312951d21a49729e9.tar.bz2 gcc-patches-312531e36b7f7ba758d76da312951d21a49729e9.zip |
stop enabling -Wformat security warnings by default in older versions for compatibility and simplicity -- these are really only used for old builds now and cross-compiling
Diffstat (limited to '4.5.4')
-rw-r--r-- | 4.5.4/gentoo/10_all_gcc-default-format-security.patch | 50 | ||||
-rw-r--r-- | 4.5.4/gentoo/99_all_testsuite-01-Wformat.patch | 391 | ||||
-rw-r--r-- | 4.5.4/gentoo/README.history | 2 |
3 files changed, 2 insertions, 441 deletions
diff --git a/4.5.4/gentoo/10_all_gcc-default-format-security.patch b/4.5.4/gentoo/10_all_gcc-default-format-security.patch deleted file mode 100644 index 8631396..0000000 --- a/4.5.4/gentoo/10_all_gcc-default-format-security.patch +++ /dev/null @@ -1,50 +0,0 @@ -ripped from Debian - -# DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++. - ---- gcc/c-common.c -+++ gcc/c-common.c -@@ -277,7 +277,7 @@ - /* Warn about format/argument anomalies in calls to formatted I/O functions - (*printf, *scanf, strftime, strfmon, etc.). */ - --int warn_format; -+int warn_format = 1; - - /* Warn about using __null (as NULL in C++) as sentinel. For code compiled - with GCC this doesn't matter as __null is guaranteed to have the right ---- gcc/c.opt -+++ gcc/c.opt -@@ -228,7 +228,7 @@ - Warn about format strings that contain NUL bytes - - Wformat-security --C ObjC C++ ObjC++ Var(warn_format_security) Warning -+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning - Warn about possible security problems with format functions - - Wformat-y2k ---- gcc/doc/invoke.texi -+++ gcc/doc/invoke.texi -@@ -2802,6 +2802,9 @@ - @option{-Wformat-nonliteral}, @option{-Wformat-security}, and - @option{-Wformat=2} are available, but are not included in @option{-Wall}. - -+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++. -+To disable, use @option{-Wformat=0}. -+ - @item -Wformat-y2k - @opindex Wformat-y2k - @opindex Wno-format-y2k -@@ -2849,6 +2852,11 @@ - in future warnings may be added to @option{-Wformat-security} that are not - included in @option{-Wformat-nonliteral}.) - -+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++. -+To disable, use @option{-Wno-format-security}, or disable all format warnings -+with @option{-Wformat=0}. To make format security warnings fatal, specify -+@option{-Werror=format-security}. -+ - @item -Wformat=2 - @opindex Wformat=2 - @opindex Wno-format=2 diff --git a/4.5.4/gentoo/99_all_testsuite-01-Wformat.patch b/4.5.4/gentoo/99_all_testsuite-01-Wformat.patch deleted file mode 100644 index 9ac9221..0000000 --- a/4.5.4/gentoo/99_all_testsuite-01-Wformat.patch +++ /dev/null @@ -1,391 +0,0 @@ - Workaround testsuite failures caused by enabling -Wformat -Wformat-security - by default. - - gcc/testsuite/g++.dg/abi/pragma-pack1.C | 1 + - gcc/testsuite/g++.dg/ext/align1.C | 2 ++ - gcc/testsuite/g++.dg/opt/alias2.C | 2 +- - gcc/testsuite/g++.old-deja/g++.abi/vbase1.C | 1 + - gcc/testsuite/g++.old-deja/g++.brendan/template8.C | 1 + - gcc/testsuite/g++.old-deja/g++.jason/access23.C | 1 + - gcc/testsuite/g++.old-deja/g++.law/cvt8.C | 1 + - gcc/testsuite/g++.old-deja/g++.law/operators28.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/net35.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/offset1.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p12306.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p3579.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p3708.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p3708a.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p3708b.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p646.C | 2 +- - gcc/testsuite/g++.old-deja/g++.mike/p710.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/p789a.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/pmf2.C | 1 + - gcc/testsuite/g++.old-deja/g++.mike/temp.C | 1 + - gcc/testsuite/g++.old-deja/g++.other/virtual8.C | 1 + - gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C | 1 + - gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C | 1 + - gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C | 1 + - gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C | 1 + - gcc/testsuite/g++.old-deja/g++.pt/t39.C | 1 + - gcc/testsuite/g++.old-deja/g++.robertl/eb17.C | 1 + - gcc/testsuite/gcc.dg/charset/builtin2.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-1.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-2.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-3.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-4.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-5.c | 2 +- - gcc/testsuite/gcc.dg/format/opt-6.c | 2 +- - gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c | 2 +- - gcc/testsuite/gcc.dg/matrix/matrix-2.c | 2 +- - gcc/testsuite/gcc.dg/packed-vla.c | 2 +- - gcc/testsuite/gcc.dg/pch/inline-4.c | 2 ++ - gcc/testsuite/gcc.dg/pr30473.c | 2 +- - gcc/testsuite/gcc.dg/pr38902.c | 2 +- - 40 files changed, 42 insertions(+), 14 deletions(-) - ---- a/gcc/testsuite/g++.dg/abi/pragma-pack1.C -+++ b/gcc/testsuite/g++.dg/abi/pragma-pack1.C -@@ -1,3 +1,4 @@ -+/* { dg-options "-Wformat=0" } */ - // PR c++/7046 - - extern "C" int printf (const char *, ...); ---- a/gcc/testsuite/g++.dg/ext/align1.C -+++ b/gcc/testsuite/g++.dg/ext/align1.C -@@ -1,3 +1,5 @@ -+/* { dg-options "-Wformat=0" } */ -+ - // Test that __attribute__ ((aligned)) is preserved. - // The alignment used to be 64 but Cygwin does not - // support an alignment greater than 16 and COFF ---- a/gcc/testsuite/g++.dg/opt/alias2.C -+++ b/gcc/testsuite/g++.dg/opt/alias2.C -@@ -1,5 +1,5 @@ - // { dg-do run } --// { dg-options "-O2" } -+// { dg-options "-O2 -Wformat=0" } - - extern "C" int printf (const char*, ...); - ---- a/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C -+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase1.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // Copyright (C) 2000 Free Software Foundation, Inc. - // Contributed by Nathan Sidwell 16 Jan 2001 <nathan@codesourcery.com> - ---- a/gcc/testsuite/g++.old-deja/g++.brendan/template8.C -+++ b/gcc/testsuite/g++.old-deja/g++.brendan/template8.C -@@ -1,4 +1,5 @@ - // { dg-do assemble } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed templates - #include <stdio.h> - ---- a/gcc/testsuite/g++.old-deja/g++.jason/access23.C -+++ b/gcc/testsuite/g++.old-deja/g++.jason/access23.C -@@ -1,4 +1,5 @@ - // { dg-do assemble } -+/* { dg-options "-Wformat=0" } */ - // PRMS Id: 9127 - // Bug: members of anonymous unions are not access-controlled. - ---- a/gcc/testsuite/g++.old-deja/g++.law/cvt8.C -+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt8.C -@@ -1,4 +1,5 @@ - // { dg-do assemble } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed conversions - // cvt file - // From: solomon@cs.wisc.edu (Marvin Solomon) ---- a/gcc/testsuite/g++.old-deja/g++.law/operators28.C -+++ b/gcc/testsuite/g++.old-deja/g++.law/operators28.C -@@ -1,4 +1,5 @@ - // { dg-do assemble } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed operators - #include <sys/types.h> - #include <stdio.h> ---- a/gcc/testsuite/g++.old-deja/g++.mike/net35.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/net35.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf(const char *, ...); - - class A { ---- a/gcc/testsuite/g++.old-deja/g++.mike/offset1.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/offset1.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf(const char *, ...); - void *vp; - int fail = 0; ---- a/gcc/testsuite/g++.old-deja/g++.mike/p12306.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p12306.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // prms-id: 12306 - - void *ptr1, *ptr2; ---- a/gcc/testsuite/g++.old-deja/g++.mike/p3579.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3579.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // prms-id: 3579 - - extern "C" int printf(const char *, ...); ---- a/gcc/testsuite/g++.old-deja/g++.mike/p3708.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // prms-id: 3708 - - extern "C" int printf (const char *, ...); ---- a/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // prms-id: 3708 - - extern "C" int printf (const char *, ...); ---- a/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // prms-id: 3708 - - extern "C" int printf (const char *, ...); ---- a/gcc/testsuite/g++.old-deja/g++.mike/p646.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p646.C -@@ -1,5 +1,5 @@ - // { dg-do assemble } --// { dg-options "-Wno-deprecated -Wreturn-type" } -+// { dg-options "-Wno-deprecated -Wreturn-type -Wformat=0" } - // GROUPS passed i960 - /* - Bug Id: bnr ---- a/gcc/testsuite/g++.old-deja/g++.mike/p710.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p710.C -@@ -1,4 +1,5 @@ - // { dg-do assemble } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed delete - /* - Bug Id: ---- a/gcc/testsuite/g++.old-deja/g++.mike/p789a.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/p789a.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - // global and local multidimensional array objects are not getting - // constructors called on any dimension, other than the first. Also, - // the destructors are not being called. Seems odd, they probably ---- a/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf(const char *, ...); - - class A_table { ---- a/gcc/testsuite/g++.old-deja/g++.mike/temp.C -+++ b/gcc/testsuite/g++.old-deja/g++.mike/temp.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf(const char *, ...); - extern "C" const char *getenv(const char *); - ---- a/gcc/testsuite/g++.old-deja/g++.other/virtual8.C -+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual8.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf (const char*, ...); - - struct A ---- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C -+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C -@@ -1,4 +1,5 @@ - // { dg-do link } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed templates membertemplates - extern "C" int printf(const char*, ...); - ---- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C -+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C -@@ -1,4 +1,5 @@ - // { dg-do link } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed templates membertemplates - extern "C" int printf(const char*, ...); - ---- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C -+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C -@@ -1,4 +1,5 @@ - // { dg-do link } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed templates membertemplates - extern "C" int printf(const char*, ...); - ---- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C -+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C -@@ -1,4 +1,5 @@ - // { dg-do link } -+/* { dg-options "-Wformat=0" } */ - // GROUPS passed templates membertemplates - extern "C" int printf(const char*, ...); - ---- a/gcc/testsuite/g++.old-deja/g++.pt/t39.C -+++ b/gcc/testsuite/g++.old-deja/g++.pt/t39.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - extern "C" int printf (const char *, ...); - - template <class T> ---- a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C -+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C -@@ -1,4 +1,5 @@ - // { dg-do run } -+/* { dg-options "-Wformat=0" } */ - #include <stdio.h> - - class A { ---- a/gcc/testsuite/gcc.dg/charset/builtin2.c -+++ b/gcc/testsuite/gcc.dg/charset/builtin2.c -@@ -3,7 +3,7 @@ - - /* { dg-do compile } */ - /* { dg-require-iconv "IBM1047" } */ --/* { dg-options "-O2 -fexec-charset=IBM1047" } */ -+/* { dg-options "-O2 -fexec-charset=IBM1047 -Wformat=0" } */ - /* { dg-final { scan-assembler-not "printf" } } */ - /* { dg-final { scan-assembler-not "fprintf" } } */ - /* { dg-final { scan-assembler-not "sprintf" } } */ ---- a/gcc/testsuite/gcc.dg/format/opt-1.c -+++ b/gcc/testsuite/gcc.dg/format/opt-1.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-extra-args. */ - /* Origin: Joseph Myers <joseph@codesourcery.com> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-extra-args" } */ -+/* { dg-options "-Wformat=0 -Wformat-extra-args" } */ - - /* { dg-warning "-Wformat-extra-args ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/format/opt-2.c -+++ b/gcc/testsuite/gcc.dg/format/opt-2.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-nonliteral. */ - /* Origin: Joseph Myers <joseph@codesourcery.com> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-nonliteral" } */ -+/* { dg-options "-Wformat=0 -Wformat-nonliteral" } */ - - /* { dg-warning "-Wformat-nonliteral ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/format/opt-3.c -+++ b/gcc/testsuite/gcc.dg/format/opt-3.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-security. */ - /* Origin: Joseph Myers <joseph@codesourcery.com> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-security" } */ -+/* { dg-options "-Wformat=0 -Wformat-security" } */ - - /* { dg-warning "-Wformat-security ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/format/opt-4.c -+++ b/gcc/testsuite/gcc.dg/format/opt-4.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-y2k. */ - /* Origin: Joseph Myers <joseph@codesourcery.com> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-y2k" } */ -+/* { dg-options "-Wformat=0 -Wformat-y2k" } */ - - /* { dg-warning "-Wformat-y2k ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/format/opt-5.c -+++ b/gcc/testsuite/gcc.dg/format/opt-5.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-zero-length. */ - /* Origin: Joseph Myers <joseph@codesourcery.com> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-zero-length" } */ -+/* { dg-options "-Wformat=0 -Wformat-zero-length" } */ - - /* { dg-warning "-Wformat-zero-length ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/format/opt-6.c -+++ b/gcc/testsuite/gcc.dg/format/opt-6.c -@@ -2,6 +2,6 @@ - -Wformat. -Wformat-contains-nul. */ - /* Origin: Bruce Korb <bkorb@gnu.org> */ - /* { dg-do compile } */ --/* { dg-options "-Wformat-contains-nul" } */ -+/* { dg-options "-Wformat=0 -Wformat-contains-nul" } */ - - /* { dg-warning "-Wformat-contains-nul ignored without -Wformat" "ignored" { target *-*-* } 0 } */ ---- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c -+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c -@@ -1,5 +1,5 @@ - /* { dg-do run } */ --/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */ -+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details -Wformat=0" } */ - - struct bovid - { ---- a/gcc/testsuite/gcc.dg/matrix/matrix-2.c -+++ b/gcc/testsuite/gcc.dg/matrix/matrix-2.c -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-do run } */ -- -+/* { dg-options "-Wformat=0" } */ - - #include <stdio.h> - #include <stdlib.h> ---- a/gcc/testsuite/gcc.dg/packed-vla.c -+++ b/gcc/testsuite/gcc.dg/packed-vla.c -@@ -1,6 +1,6 @@ - /* PR middle-end/27945 */ - /* { dg-do run } */ --/* { dg-options "" } */ -+/* { dg-options "-Wformat=0" } */ - - extern int printf (const char *, ...); - extern void abort (); ---- a/gcc/testsuite/gcc.dg/pch/inline-4.c -+++ b/gcc/testsuite/gcc.dg/pch/inline-4.c -@@ -1,3 +1,5 @@ -+/* { dg-options "-Wformat=0" } */ -+ - #include "inline-4.h" - extern int printf (const char *, ...); - int main(void) { ---- a/gcc/testsuite/gcc.dg/pr30473.c -+++ b/gcc/testsuite/gcc.dg/pr30473.c -@@ -1,7 +1,7 @@ - /* PR middle-end/30473 */ - /* Make sure this doesn't ICE. */ - /* { dg-do compile } */ --/* { dg-options "-O2" } */ -+/* { dg-options "-O2 -Wformat=0" } */ - - extern int sprintf (char *, const char *, ...); - ---- a/gcc/testsuite/gcc.dg/pr38902.c -+++ b/gcc/testsuite/gcc.dg/pr38902.c -@@ -1,6 +1,6 @@ - /* PR target/38902 */ - /* { dg-do run } */ --/* { dg-options "-O2 -fstack-protector" } */ -+/* { dg-options "-O2 -fstack-protector -Wformat=0" } */ - /* { dg-require-effective-target fstack_protector } */ - - #ifdef DEBUG diff --git a/4.5.4/gentoo/README.history b/4.5.4/gentoo/README.history index 8aace3d..00b7662 100644 --- a/4.5.4/gentoo/README.history +++ b/4.5.4/gentoo/README.history @@ -1,7 +1,9 @@ 1.3 [pending] - 09_all_gcc-4.5-Wtrampolines.patch + - 10_all_gcc-default-format-security.patch + 18_all_libgcc-cross-canadian.patch + 34_all_libjava-classpath-locale-sort.patch + - 99_all_testsuite-01-Wformat.patch - 99_all_testsuite-02-Wtrampolines.patch 1.2 19 Apr 2013 |