aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-05-01 07:16:10 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-05-01 07:16:10 +0000
commitd00887e89999f5f24210f6cd6c3895a64eb9f2cd (patch)
tree0e3a810a247c23366f355169db0d3d71078a67f9 /gcc/c
parent5436fa2e87fd7df010144347bd3e1fcc0a48d901 (diff)
downloadgcc-d00887e89999f5f24210f6cd6c3895a64eb9f2cd.zip
gcc-d00887e89999f5f24210f6cd6c3895a64eb9f2cd.tar.gz
gcc-d00887e89999f5f24210f6cd6c3895a64eb9f2cd.tar.bz2
re PR c/43245 (add option to control "discarding qualifiers" warnings)
PR c/43245 * doc/invoke.texi: Document -Wdiscarded-qualifiers. c-family/ * c.opt (Wdiscarded-qualifiers): Add. c/ * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers instead of 0 to WARN_FOR_QUALIFIERS. testsuite/ * gcc.dg/pr43245.c: New test. From-SVN: r209970
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index cee0329..b10f6f7 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,11 @@
2014-05-01 Marek Polacek <polacek@redhat.com>
+ PR c/43245
+ * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers
+ instead of 0 to WARN_FOR_QUALIFIERS.
+
+2014-05-01 Marek Polacek <polacek@redhat.com>
+
PR c/56989
* c-typeck.c (default_conversion): Use better location for
error call.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 409b0a7..e25a25c 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -5852,7 +5852,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
vice-versa. */
if (TYPE_QUALS_NO_ADDR_SPACE (ttl)
& ~TYPE_QUALS_NO_ADDR_SPACE (ttr))
- WARN_FOR_QUALIFIERS (location, 0,
+ WARN_FOR_QUALIFIERS (location, OPT_Wdiscarded_qualifiers,
G_("passing argument %d of %qE "
"makes %q#v qualified function "
"pointer from unqualified"),
@@ -5868,7 +5868,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
}
else if (TYPE_QUALS_NO_ADDR_SPACE (ttr)
& ~TYPE_QUALS_NO_ADDR_SPACE (ttl))
- WARN_FOR_QUALIFIERS (location, 0,
+ WARN_FOR_QUALIFIERS (location, OPT_Wdiscarded_qualifiers,
G_("passing argument %d of %qE discards "
"%qv qualifier from pointer target type"),
G_("assignment discards %qv qualifier "
@@ -6049,7 +6049,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
if (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
& ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl))
{
- WARN_FOR_QUALIFIERS (location, 0,
+ WARN_FOR_QUALIFIERS (location, OPT_Wdiscarded_qualifiers,
G_("passing argument %d of %qE discards "
"%qv qualifier from pointer target type"),
G_("assignment discards %qv qualifier "
@@ -6086,7 +6086,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
where an ordinary one is wanted, but not vice-versa. */
if (TYPE_QUALS_NO_ADDR_SPACE (ttl)
& ~TYPE_QUALS_NO_ADDR_SPACE (ttr))
- WARN_FOR_QUALIFIERS (location, 0,
+ WARN_FOR_QUALIFIERS (location, OPT_Wdiscarded_qualifiers,
G_("passing argument %d of %qE makes "
"%q#v qualified function pointer "
"from unqualified"),