aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fd182b6..ffd92db 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 12bfb99..7d75d6f 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)