From patchwork Thu Apr 23 20:25:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Nagy X-Patchwork-Id: 19689 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3NKR2Rj013222 for ; Thu, 23 Apr 2009 20:27:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753112AbZDWU0j (ORCPT ); Thu, 23 Apr 2009 16:26:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753225AbZDWU0j (ORCPT ); Thu, 23 Apr 2009 16:26:39 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:49631 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbZDWU0i (ORCPT ); Thu, 23 Apr 2009 16:26:38 -0400 Received: by ewy24 with SMTP id 24so741683ewy.37 for ; Thu, 23 Apr 2009 13:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=ujjI/M2BbiuZUfI61RIeZGyx0PF44Z+jUeTOotgREI8=; b=t2i1/uGOiBaI1XGDthncll+sp9WwqaNB3zoRUm8IVf9NL+hwqCMVjFLR2qCIYd4Y2T Qtmw57ZGP8+E6H/uwrPEUR4h5FU6IBVg+T6anfP53MnZstNQrVxqRUGAoMTj3+AS0cka //hxbPLSC55qGxtWl5fwmJEVV4+Q18yIR+NnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; b=e8hRQ5RPXr79EMrKPFKpNTMDffWT5Zj5k0r5jEXehJZZ/Xgj/jlGRc2QCEdyP0rEMG komGHlxyAFWqOYcV2Nn7vImFpTHpTdQuqYEVrLhx0K2xSVDBHZXSe1mKKNCUqlRfPtLz BmfkqQ0M1JKniVM7xvrf7Ukjb6y4+uZ4G8Yzo= Received: by 10.210.143.9 with SMTP id q9mr1416714ebd.85.1240518396183; Thu, 23 Apr 2009 13:26:36 -0700 (PDT) Received: from notas (r2ah146.net.upc.cz [62.245.97.146]) by mx.google.com with ESMTPS id 7sm581922eyg.57.2009.04.23.13.26.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Apr 2009 13:26:35 -0700 (PDT) Date: Thu, 23 Apr 2009 22:25:19 +0200 From: Martin Nagy To: linux-sparse@vger.kernel.org Subject: [PATCH] Add missing checks for Waddress-space Message-ID: <20090423222519.48191d61@notas> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.12.12; i386-redhat-linux-gnu) Mime-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org 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 --- evaluate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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; }