===================================================================
@@ -4493,9 +4493,12 @@
&& !is_const)
{
int added = TYPE_QUALS (in_type) &~ TYPE_QUALS (in_otype);
- warning (OPT_Wcast_qual,
- ("new %qv qualifier in middle of multi-level non-const cast "
- "is unsafe"), added);
+ if (warning_at (input_location, OPT_Wcast_qual,
+ "%qv qualifier in cast from %qT to %qT is unsafe",
+ added, in_type, in_otype))
+ inform (input_location,
+ G_("to be safe all intermediate pointers"
+ " must be equally qualified"));
break;
}
if (is_const)