aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-07-01 08:31:58 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-07-01 08:31:58 +0000
commitd5c3d343bdc26d8d16d2a3b20c25dce3c619ff69 (patch)
tree877b640f90c7fa56352477c59e8e3116c904da16 /gcc/c
parente55637b71514b1f2106980ff1e8951d5d072f9c4 (diff)
downloadgcc-d5c3d343bdc26d8d16d2a3b20c25dce3c619ff69.zip
gcc-d5c3d343bdc26d8d16d2a3b20c25dce3c619ff69.tar.gz
gcc-d5c3d343bdc26d8d16d2a3b20c25dce3c619ff69.tar.bz2
re PR c/58286 (Need option to make incompatible pointer type warnings into compiler errors)
PR c/58286 * doc/invoke.texi: Document -Wincompatible-pointer-types. c-family/ * c.opt (Wincompatible-pointer-types): New option. c/ * c-typeck.c (convert_for_assignment): Pass OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT. testsuite/ * gcc.dg/Wincompatible-pointer-types.c: New test. From-SVN: r212192
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 6740d51..c64c553 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-01 Marek Polacek <polacek@redhat.com>
+
+ PR c/58286
+ * c-typeck.c (convert_for_assignment): Pass
+ OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
+
2014-06-30 Marek Polacek <polacek@redhat.com>
* c-decl.c (grokdeclarator): Don't instrument VLAs if the function
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index b62e830..fff26a3 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -6189,7 +6189,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
else
/* Avoid warning about the volatile ObjC EH puts on decls. */
if (!objc_ok)
- WARN_FOR_ASSIGNMENT (location, expr_loc, 0,
+ WARN_FOR_ASSIGNMENT (location, expr_loc,
+ OPT_Wincompatible_pointer_types,
G_("passing argument %d of %qE from "
"incompatible pointer type"),
G_("assignment from incompatible pointer type"),