diff mbox

Add missing checks for Waddress-space

Message ID 20090423222519.48191d61@notas (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Martin Nagy April 23, 2009, 8:25 p.m. UTC
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(-)

Comments

Christopher Li April 24, 2009, 10:53 p.m. UTC | #1
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
diff mbox

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;
 			}