diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-06-24 16:17:42 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-06-24 16:17:42 -0400 |
commit | 796bb3734a77e914b31b48811eebe0523f334f9c (patch) | |
tree | e7a4e69fdc356ce5f59c555f1d9a072774b1d55b | |
parent | 5c8902bb1a4e99e69a1d9daeae1165bc7abcbf76 (diff) | |
download | gcc-796bb3734a77e914b31b48811eebe0523f334f9c.zip gcc-796bb3734a77e914b31b48811eebe0523f334f9c.tar.gz gcc-796bb3734a77e914b31b48811eebe0523f334f9c.tar.bz2 |
(build_c_cast): Issue a warning for non-matching cast from a function
call (like malloc without proto).
From-SVN: r7562
-rw-r--r-- | gcc/c-typeck.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 659a3e3..80c236f 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3606,6 +3606,11 @@ build_c_cast (type, expr) && !TREE_CONSTANT (value)) warning ("cast from pointer to integer of different size"); + if (warn_bad_function_cast + && TREE_CODE (value) == CALL_EXPR + && TREE_CODE (type) != TREE_CODE (otype)) + warning ("cast does not match function type"); + if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == INTEGER_TYPE && TYPE_PRECISION (type) != TYPE_PRECISION (otype) |