From f05ae87e33092ff9fab9f518887c9dfcb9e32a70 Mon Sep 17 00:00:00 2001
From: Martin Nagy <nagy.martin@gmail.com>
Date: Sat, 25 Apr 2009 06:44:49 +0200
Subject: [PATCH] Ignore address space if !Waddress_space
Remove all previous checks for Waddress_space and add one centralized to
the address_space attribute handler. If user passes the
-Wno-address-space option, we behave as if every pointer had no address
space.
Signed-off-by: Martin Nagy <nagy.martin@gmail.com>
---
evaluate.c | 8 ++++----
parse.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
@@ -689,7 +689,7 @@ const char *type_difference(struct ctype *c1, struct ctype *c2,
/* XXX: we ought to compare sizes */
break;
case SYM_PTR:
- if (Waddress_space && as1 != as2)
+ if (as1 != as2)
return "different address spaces";
/* MOD_SPECIFIER is due to idiocy in parse.c */
if ((mod1 ^ mod2) & ~MOD_IGNORE & ~MOD_SPECIFIER)
@@ -706,7 +706,7 @@ const char *type_difference(struct ctype *c1, struct ctype *c2,
struct symbol *arg1, *arg2;
int i;
- if (Waddress_space && as1 != as2)
+ if (as1 != as2)
return "different address spaces";
if ((mod1 ^ mod2) & ~MOD_IGNORE & ~MOD_SIGNEDNESS)
return "different modifiers";
@@ -745,7 +745,7 @@ const char *type_difference(struct ctype *c1, struct ctype *c2,
break;
}
case SYM_BASETYPE:
- if (Waddress_space && as1 != as2)
+ if (as1 != as2)
return "different address spaces";
if (base1 != base2)
return "different base types";
@@ -762,7 +762,7 @@ const char *type_difference(struct ctype *c1, struct ctype *c2,
t1 = base1;
t2 = base2;
}
- if (Waddress_space && as1 != as2)
+ if (as1 != as2)
return "different address spaces";
if ((mod1 ^ mod2) & ~MOD_IGNORE & ~MOD_SIGNEDNESS)
return "different modifiers";
@@ -987,7 +987,7 @@ static struct token *attribute_address_space(struct token *token, struct symbol
token = conditional_expression(token, &expr);
if (expr) {
as = const_expression_value(expr);
- if (as)
+ if (Waddress_space && as)
ctx->ctype.as = as;
}
token = expect(token, ')', "after address_space attribute");
--
1.6.0.6