re PR c/55383 (-Wcast-qual reports incorrect message)

2014-03-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c/55383
c/
	* c-typeck.c: Use correct format string in cast-qual warning
testsuite/
	* c-c++-common/Wcast-qual-1.c: More precise match text.

From-SVN: r208661
parent b318e404
2014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/55383
* c-typeck.c: Use correct format string in cast-qual warning
2014-03-07 Thomas Schwinge <thomas@codesourcery.com> 2014-03-07 Thomas Schwinge <thomas@codesourcery.com>
* c-decl.c (c_decl_attributes): Use * c-decl.c (c_decl_attributes): Use
......
...@@ -4855,7 +4855,7 @@ handle_warn_cast_qual (location_t loc, tree type, tree otype) ...@@ -4855,7 +4855,7 @@ handle_warn_cast_qual (location_t loc, tree type, tree otype)
/* There are qualifiers present in IN_OTYPE that are not present /* There are qualifiers present in IN_OTYPE that are not present
in IN_TYPE. */ in IN_TYPE. */
warning_at (loc, OPT_Wcast_qual, warning_at (loc, OPT_Wcast_qual,
"cast discards %q#v qualifier from pointer target type", "cast discards %qv qualifier from pointer target type",
discarded); discarded);
if (added || discarded) if (added || discarded)
......
2014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/55383
* c-c++-common/Wcast-qual-1.c: More precise match text.
2014-03-18 Paolo Carlini <paolo.carlini@oracle.com> 2014-03-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60305 PR c++/60305
......
...@@ -85,11 +85,11 @@ f3 (void ***bar) ...@@ -85,11 +85,11 @@ f3 (void ***bar)
void void
f4 (void * const **bar) f4 (void * const **bar)
{ {
const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */ const void ***p9 = (const void ***) bar; /* { dg-warning "cast discards .const. qualifier " } */
void * const **p11 = (void * const **) bar; void * const **p11 = (void * const **) bar;
void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */ void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */
const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */ const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */
const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */ const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */
void * const * const * p19 = (void * const * const *) bar; void * const * const * p19 = (void * const * const *) bar;
const void * const * const *p21 = (const void * const * const *) bar; const void * const * const *p21 = (const void * const * const *) bar;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment