From d5c3d343bdc26d8d16d2a3b20c25dce3c619ff69 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 1 Jul 2014 08:31:58 +0000 Subject: 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 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-typeck.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/c') 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 + + 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 * 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"), -- cgit v1.1