summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-03-10 23:28:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-12 18:33:28 +0000
commitf6cc25ce1214e7e52769c3ffba118cf2af3b42ca (patch)
treeeae2a0a97574c14e0316abe435cc24b5857b67df
parent975e259d2e6d47691248d1eb92440c6ef87aceaf (diff)
downloadpoky-f6cc25ce1214e7e52769c3ffba118cf2af3b42ca.tar.gz
gcc-4.7: Fix incorrect warning with -Wcast-qual
This patch backport the fix where -Wcast-qual reports a bogus warning with 4.7.2, There is no workaround in code that can be done to avoid it hence the fix to gcc is backported. (From OE-Core rev: 5d8ef98225773a6ec88b5e1a76ce01d76163b3a5) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7.inc3
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/wcast-qual-PR55383.patch43
2 files changed, 45 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index 8735e48896..49f4010b49 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -1,6 +1,6 @@
1require gcc-common.inc 1require gcc-common.inc
2 2
3PR = "r18" 3PR = "r19"
4 4
5# Third digit in PV should be incremented after a minor release 5# Third digit in PV should be incremented after a minor release
6# happens from this branch on gcc e.g. currently its 4.7.1 6# happens from this branch on gcc e.g. currently its 4.7.1
@@ -75,6 +75,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
75 file://0001-crtstuff.c-USE_PT_GNU_EH_FRAME-Define-for-systems-us.patch \ 75 file://0001-crtstuff.c-USE_PT_GNU_EH_FRAME-Define-for-systems-us.patch \
76 file://0001-Makefile.in-vis_hide-gen-hide-list-Do-not-make-defin.patch \ 76 file://0001-Makefile.in-vis_hide-gen-hide-list-Do-not-make-defin.patch \
77 file://use-ml-conf-files-from-B.patch \ 77 file://use-ml-conf-files-from-B.patch \
78 file://wcast-qual-PR55383.patch \
78 " 79 "
79SRC_URI[md5sum] = "cc308a0891e778cfda7a151ab8a6e762" 80SRC_URI[md5sum] = "cc308a0891e778cfda7a151ab8a6e762"
80SRC_URI[sha256sum] = "8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084" 81SRC_URI[sha256sum] = "8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084"
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/wcast-qual-PR55383.patch b/meta/recipes-devtools/gcc/gcc-4.7/wcast-qual-PR55383.patch
new file mode 100644
index 0000000000..7c5bbe7620
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/wcast-qual-PR55383.patch
@@ -0,0 +1,43 @@
1This is a backport from gcc bugzilla
2
3http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383
4
5fixes wrong warning behavior which has no workaround
6other than disabling the warning
7
8Upstream-Status: Backport
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12Index: gcc-4.7.2/gcc/c-typeck.c
13===================================================================
14--- gcc-4.7.2.orig/gcc/c-typeck.c 2012-09-13 10:04:44.000000000 -0700
15+++ gcc-4.7.2/gcc/c-typeck.c 2013-03-10 23:09:17.610899536 -0700
16@@ -4557,7 +4557,7 @@
17 /* There are qualifiers present in IN_OTYPE that are not present
18 in IN_TYPE. */
19 warning_at (loc, OPT_Wcast_qual,
20- "cast discards %q#v qualifier from pointer target type",
21+ "cast discards %qv qualifier from pointer target type",
22 discarded);
23
24 if (added || discarded)
25Index: gcc-4.7.2/gcc/testsuite/c-c++-common/Wcast-qual-1.c
26===================================================================
27--- gcc-4.7.2.orig/gcc/testsuite/c-c++-common/Wcast-qual-1.c 2011-04-07 14:47:38.000000000 -0700
28+++ gcc-4.7.2/gcc/testsuite/c-c++-common/Wcast-qual-1.c 2013-03-10 23:15:45.610894589 -0700
29@@ -85,11 +85,11 @@
30 void
31 f4 (void * const **bar)
32 {
33- const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */
34+ const void ***p9 = (const void ***) bar; /* { dg-warning "cast discards .const. qualifier" } */
35 void * const **p11 = (void * const **) bar;
36- void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */
37+ void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */
38 const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */
39- const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */
40+ const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */
41 void * const * const * p19 = (void * const * const *) bar;
42 const void * const * const *p21 = (const void * const * const *) bar;
43 }