Patchworkβ Add missing checks for Waddress-space

login
register
about
Submitter Martin Nagy
Date 2009-04-23 20:25:19
Message ID <20090423222519.48191d61@notas>
Download mbox | patch
Permalink /patch/19689/
State New
Headers show

Comments

Martin Nagy - 2009-04-23 20:25:19
Some of these are missing in evaluate.c. Maybe we should change the
option to not consider address space at all, if unset. It would be much
easier to make attribute_address_space() ignore it.

Signed-off-by: Martin Nagy <nagy.martin@gmail.com>
---
 evaluate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Christopher Li - 2009-04-24 22:53:58
On Thu, Apr 23, 2009 at 1:25 PM, Martin Nagy <nagy.martin@gmail.com> wrote:
>
> Some of these are missing in evaluate.c. Maybe we should change the
> option to not consider address space at all, if unset. It would be much
> easier to make attribute_address_space() ignore it.

I think disable it at attribute_address_space() might be better.
Otherwise is_same_type() will still return false for address space difference.
There are too many places to track down the address space comparison.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/evaluate.c b/evaluate.c
index 5c3812e..be7a17c 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1149,7 +1149,7 @@  static struct symbol *evaluate_conditional_expression(struct expression *expr)
 			goto Err;
 		}
 		/* OK, it's pointer on pointer */
-		if (ltype->ctype.as != rtype->ctype.as) {
+		if (Waddress_space && ltype->ctype.as != rtype->ctype.as) {
 			typediff = "different address spaces";
 			goto Err;
 		}
@@ -1339,7 +1339,7 @@  static int compatible_assignment_types(struct expression *expr, struct symbol *t
 			 * we do not remove qualifiers from pointed to [C]
 			 * or mix address spaces [sparse].
 			 */
-			if (t->ctype.as != s->ctype.as) {
+			if (Waddress_space && t->ctype.as != s->ctype.as) {
 				typediff = "different address spaces";
 				goto Err;
 			}