diff options
author | Marek Polacek <polacek@redhat.com> | 2014-07-01 08:53:12 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-07-01 08:53:12 +0000 |
commit | 52ec0ea334753fbe7a81c15c17636fb22a3c7d2d (patch) | |
tree | 98e47da6bde5358750ba0aac6b53b099e2e8eee6 /gcc/c | |
parent | d5c3d343bdc26d8d16d2a3b20c25dce3c619ff69 (diff) | |
download | gcc-52ec0ea334753fbe7a81c15c17636fb22a3c7d2d.zip gcc-52ec0ea334753fbe7a81c15c17636fb22a3c7d2d.tar.gz gcc-52ec0ea334753fbe7a81c15c17636fb22a3c7d2d.tar.bz2 |
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
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 6 |
2 files changed, 9 insertions, 2 deletions
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 <polacek@redhat.com> + * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion + instead of 0 to WARN_FOR_ASSIGNMENT. + +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. 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 " |