Always set the result type of pointer - pointer to type_ptrdiff_t disregarding whethe...
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 6 Aug 2008 09:13:05 +0000 (09:13 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 6 Aug 2008 09:13:05 +0000 (09:13 +0000)
[r21008]

parser.c

index c2f2ee9..3b7e50f 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -6459,9 +6459,8 @@ static void semantic_sub(binary_expression_t *expression)
                        errorf(HERE,
                               "pointers to incompatible objects to binary '-' ('%T', '%T')",
                               orig_type_left, orig_type_right);
-               } else {
-                       expression->base.type = type_ptrdiff_t;
                }
+               expression->base.type = type_ptrdiff_t;
        } else if (is_type_valid(type_left) && is_type_valid(type_right)) {
                errorf(HERE, "invalid operands to binary '-' ('%T', '%T')",
                       orig_type_left, orig_type_right);