aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-05-06 14:55:07 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-05-06 14:55:07 -0700
commitbf061ee4ccccf99eb7bc8480e91f46754ff22c90 (patch)
tree74000eb11f35b4a0da38d24164b3534804e93b90
parent6efd816040b35801118c5a2518bf8950efe3b183 (diff)
downloadgcc-bf061ee4ccccf99eb7bc8480e91f46754ff22c90.zip
gcc-bf061ee4ccccf99eb7bc8480e91f46754ff22c90.tar.gz
gcc-bf061ee4ccccf99eb7bc8480e91f46754ff22c90.tar.bz2
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
-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)