ports/179204: [patch] lang/gcc4[6789]: -Wcast-qual reports incorrect message
Sergey Kandaurov
pluknet at gmail.com
Sun Jun 2 15:30:00 UTC 2013
>Number: 179204
>Category: ports
>Synopsis: [patch] lang/gcc4[6789]: -Wcast-qual reports incorrect message
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jun 02 15:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Sergey Kandaurov
>Release: FreeBSD 9.1-STABLE
>Organization:
>Environment:
FreeBSD omg 9.1-STABLE FreeBSD 9.1-STABLE #0: Sun Mar 24 18:49:50 MSK 2013 root at omg:/usr/obj/amd64.amd64/usr/src/sys/GENERIC amd64
>Description:
This is a request to apply patch from GNU GCC Bugzilla report 55383.
gcc erroneously reports incorrect message about casting volatile to non-volatile like this:
src/core/ngx_connection.c:988:29: error: cast discards '__attribute__((noreturn))' qualifier from pointer target type [-Werror=cast-qual]
The correct warning message:
src/core/ngx_connection.c:988:29: error: cast discards 'volatile' qualifier from pointer target type [-Werror=cast-qual]
The applied patch as from Bugzilla PR c/55383 fixes it.
Please note that at the time of filing this PR the patch has status NEW and is not committed to gcc tree.
>How-To-Repeat:
>Fix:
Apply patch generated against ports svn tree.
Patch attached with submission follows:
Index: lang/gcc46/files/patch-c-typeck.c
===================================================================
--- lang/gcc46/files/patch-c-typeck.c (revision 0)
+++ lang/gcc46/files/patch-c-typeck.c (working copy)
@@ -0,0 +1,17 @@
+Manuel López-Ibáñez 2012-11-18 21:15:09 UTC
+
+ PR c/55383
+ * c/c-typeck.c: Use %qv for non-function types
+
+--- gcc/c-typeck.c~ 2012-09-15 04:29:28.000000000 +0400
++++ gcc/c-typeck.c 2013-06-02 13:57:25.000000000 +0400
+@@ -4456,7 +4456,7 @@
+ /* There are qualifiers present in IN_OTYPE that are not present
+ in IN_TYPE. */
+ warning_at (loc, OPT_Wcast_qual,
+- "cast discards %q#v qualifier from pointer target type",
++ "cast discards %qv qualifier from pointer target type",
+ discarded);
+
+ if (added || discarded)
+
Index: lang/gcc47/files/patch-c-typeck.c
===================================================================
--- lang/gcc47/files/patch-c-typeck.c (revision 0)
+++ lang/gcc47/files/patch-c-typeck.c (working copy)
@@ -0,0 +1,17 @@
+Manuel López-Ibáñez 2012-11-18 21:15:09 UTC
+
+ PR c/55383
+ * c/c-typeck.c: Use %qv for non-function types
+
+--- gcc/c-typeck.c~ 2012-09-15 04:29:28.000000000 +0400
++++ gcc/c-typeck.c 2013-06-02 13:57:25.000000000 +0400
+@@ -4456,7 +4456,7 @@
+ /* There are qualifiers present in IN_OTYPE that are not present
+ in IN_TYPE. */
+ warning_at (loc, OPT_Wcast_qual,
+- "cast discards %q#v qualifier from pointer target type",
++ "cast discards %qv qualifier from pointer target type",
+ discarded);
+
+ if (added || discarded)
+
Index: lang/gcc48/files/patch-c-typeck.c
===================================================================
--- lang/gcc48/files/patch-c-typeck.c (revision 0)
+++ lang/gcc48/files/patch-c-typeck.c (working copy)
@@ -0,0 +1,17 @@
+Manuel López-Ibáñez 2012-11-18 21:15:09 UTC
+
+ PR c/55383
+ * c/c-typeck.c: Use %qv for non-function types
+
+--- gcc/c/c-typeck.c~ 2012-09-15 04:29:28.000000000 +0400
++++ gcc/c/c-typeck.c 2013-06-02 13:57:25.000000000 +0400
+@@ -4456,7 +4456,7 @@
+ /* There are qualifiers present in IN_OTYPE that are not present
+ in IN_TYPE. */
+ warning_at (loc, OPT_Wcast_qual,
+- "cast discards %q#v qualifier from pointer target type",
++ "cast discards %qv qualifier from pointer target type",
+ discarded);
+
+ if (added || discarded)
+
Index: lang/gcc49/files/patch-c-typeck.c
===================================================================
--- lang/gcc49/files/patch-c-typeck.c (revision 0)
+++ lang/gcc49/files/patch-c-typeck.c (working copy)
@@ -0,0 +1,17 @@
+Manuel López-Ibáñez 2012-11-18 21:15:09 UTC
+
+ PR c/55383
+ * c/c-typeck.c: Use %qv for non-function types
+
+--- gcc/c/c-typeck.c~ 2012-09-15 04:29:28.000000000 +0400
++++ gcc/c/c-typeck.c 2013-06-02 13:57:25.000000000 +0400
+@@ -4456,7 +4456,7 @@
+ /* There are qualifiers present in IN_OTYPE that are not present
+ in IN_TYPE. */
+ warning_at (loc, OPT_Wcast_qual,
+- "cast discards %q#v qualifier from pointer target type",
++ "cast discards %qv qualifier from pointer target type",
+ discarded);
+
+ if (added || discarded)
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list