From 52ec0ea334753fbe7a81c15c17636fb22a3c7d2d Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 1 Jul 2014 08:53:12 +0000 Subject: invoke.texi: Document -Wint-conversion. * doc/invoke.texi: Document -Wint-conversion. c-family/ * c.opt (Wint-conversion): New option. c/ * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion instead of 0 to WARN_FOR_ASSIGNMENT. testsuite/ * gcc.dg/Wint-conversion.c: New test. From-SVN: r212193 --- gcc/c/ChangeLog | 5 +++++ gcc/c/c-typeck.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index c64c553..1c19362 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,10 @@ 2014-07-01 Marek Polacek + * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion + instead of 0 to WARN_FOR_ASSIGNMENT. + +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. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index fff26a3..35bfd14 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -6213,7 +6213,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, or one that results from arithmetic, even including a cast to integer type. */ if (!null_pointer_constant) - WARN_FOR_ASSIGNMENT (location, expr_loc, 0, + WARN_FOR_ASSIGNMENT (location, expr_loc, + OPT_Wint_conversion, G_("passing argument %d of %qE makes " "pointer from integer without a cast"), G_("assignment makes pointer from integer " @@ -6227,7 +6228,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, } else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) { - WARN_FOR_ASSIGNMENT (location, expr_loc, 0, + WARN_FOR_ASSIGNMENT (location, expr_loc, + OPT_Wint_conversion, G_("passing argument %d of %qE makes integer " "from pointer without a cast"), G_("assignment makes integer from pointer " -- cgit v1.1