Commit 796bb373 by Richard Kenner

(build_c_cast): Issue a warning for non-matching cast from a function

call (like malloc without proto).

From-SVN: r7562
parent 5c8902bb
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment