Commit bf061ee4 by Richard Henderson Committed by Richard Henderson

typeck.c (build_c_cast): Don't warn integer->pointer size mismatch for constants.

        * typeck.c (build_c_cast): Don't warn integer->pointer size
        mismatch for constants.

From-SVN: r33740
parent 6efd8160
2000-05-06 Richard Henderson <rth@cygnus.com>
* typeck.c (build_c_cast): Don't warn integer->pointer size
mismatch for constants.
2000-05-06 Nathan Sidwell <nathan@codesourcery.com>
* rtti.c (ptmd_initializer): Set non-public, if class is
......
......@@ -5481,9 +5481,8 @@ build_c_cast (type, expr)
if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (otype) == INTEGER_TYPE
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype)
/* Don't warn about converting 0 to pointer,
provided the 0 was explicit--not cast or made by folding. */
&& !(TREE_CODE (value) == INTEGER_CST && integer_zerop (value)))
/* Don't warn about converting any constant. */
&& !TREE_CONSTANT (value))
warning ("cast to pointer from integer of different size");
if (TREE_CODE (type) == REFERENCE_TYPE)
......
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