]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(build_c_cast): Issue a warning for non-matching cast from a function
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 24 Jun 1994 20:17:42 +0000 (16:17 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 24 Jun 1994 20:17:42 +0000 (16:17 -0400)
call (like malloc without proto).

From-SVN: r7562

gcc/c-typeck.c

index 659a3e375a0a74b103d66104ebf44fe45f794f8f..80c236f36262d560c7ccd13d86d7b1bac7192ed0 100644 (file)
@@ -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)