aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-05-27 04:30:54 +0000
committerRichard Stallman <rms@gnu.org>1993-05-27 04:30:54 +0000
commit5c73b269e7da6ae0ee618f49e935a581dc0f12d7 (patch)
treed0e643611b79f6c47d82617bce33ba25fe249fe1 /gcc
parentfc1565060a2161c602d6b7bd277765d5fbd022bf (diff)
downloadgcc-5c73b269e7da6ae0ee618f49e935a581dc0f12d7.zip
gcc-5c73b269e7da6ae0ee618f49e935a581dc0f12d7.tar.gz
gcc-5c73b269e7da6ae0ee618f49e935a581dc0f12d7.tar.bz2
(convert_for_assignment): When allowing mixing of
signed and unsigned pointers, compare unsigned types not type sizes. From-SVN: r4580
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 0989b69..77599ba 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -4186,11 +4186,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
Meanwhile, the lhs target must have all the qualifiers of the rhs. */
if (TYPE_MAIN_VARIANT (ttl) == void_type_node
|| TYPE_MAIN_VARIANT (ttr) == void_type_node
- || comp_target_types (type, rhstype)
- || (!pedantic /* Unless pedantic, mix signed and unsigned. */
- && TREE_CODE (ttl) == INTEGER_TYPE
- && TREE_CODE (ttr) == INTEGER_TYPE
- && TYPE_PRECISION (ttl) == TYPE_PRECISION (ttr)))
+ || comp_target_types (type, rhstype))
{
if (pedantic
&& ((TYPE_MAIN_VARIANT (ttl) == void_type_node
@@ -4229,8 +4225,11 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
}
else if (unsigned_type (TYPE_MAIN_VARIANT (ttl))
== unsigned_type (TYPE_MAIN_VARIANT (ttr)))
- warn_for_assignment ("pointer targets in %s differ in signedness",
- get_spelling (errtype), funname, parmnum);
+ {
+ if (pedantic)
+ warn_for_assignment ("pointer targets in %s differ in signedness",
+ get_spelling (errtype), funname, parmnum);
+ }
else
warn_for_assignment ("%s from incompatible pointer type",
get_spelling (errtype), funname, parmnum);