From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11354 invoked by alias); 16 Feb 2012 23:31:40 -0000 Received: (qmail 11343 invoked by uid 22791); 16 Feb 2012 23:31:38 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Feb 2012 23:31:19 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1GNVJfv007397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Feb 2012 18:31:19 -0500 Received: from mesquite.lan (ovpn-113-100.phx2.redhat.com [10.3.113.100]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1GNVIsJ014383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 16 Feb 2012 18:31:18 -0500 Date: Thu, 16 Feb 2012 23:36:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts Message-ID: <20120216163116.34dae543@mesquite.lan> In-Reply-To: <201202152350.35277.vapier@gentoo.org> References: <20120215172622.4f377c2b@mesquite.lan> <201202152350.35277.vapier@gentoo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00337.txt.bz2 On Wed, 15 Feb 2012 23:50:34 -0500 Mike Frysinger wrote: > On Wednesday 15 February 2012 19:26:22 Kevin Buettner wrote: > > Any comments on the following patch? > > uintptr_t i think would be better, but we don't seem to use that in sim/, so > this is OK > > > It fixes a bunch of warnings when building on a 64-bit host. Here > > are a few of them: > > > > ./code.c:93: warning: cast from pointer to integer of different size > > ./code.c:215: warning: cast from pointer to integer of different size > > ./code.c:230: warning: cast from pointer to integer of different size > > makes me think that this sim is incorrectly mixing target and host types My reading of the code shows that (the variable behind) PC is char *. (PC is a macro defined to be insn_ptr.) The MA macro needs to convert that pointer to an int type in order to apply the mask. So I agree that uintptr_t would be the right thing to use. I've committed my patch, but if you wish I can try it with uintptr_t. This will require us to include stdint.h. Kevin