From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9619 invoked by alias); 7 Mar 2008 18:55:31 -0000 Received: (qmail 9610 invoked by uid 22791); 7 Mar 2008 18:55:31 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Mar 2008 18:55:03 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 0ABCA3C69E; Fri, 7 Mar 2008 10:55:01 -0800 (PST) Subject: Re: [RFA] compilation error in remote.c on sparc-solaris From: Michael Snyder To: Joel Brobecker Cc: gdb-patches@sourceware.org In-Reply-To: <20080307182744.GG3995@adacore.com> References: <20080307182744.GG3995@adacore.com> Content-Type: text/plain Date: Fri, 07 Mar 2008 18:55:00 -0000 Message-Id: <1204916101.19253.715.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) 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: 2008-03/txt/msg00052.txt.bz2 On Fri, 2008-03-07 at 10:27 -0800, Joel Brobecker wrote: > Hello, > > I get the following warning when compiling remote.c on a sparc-solaris > machine: > > remote.c: In function 'extended_remote_attach_1': > remote.c:2859: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'pid_t' > > I think the problem is that, on sparc-solaris, type pid_t is defined > as a "long", whereas on other machines I've built GDB on, it's an int. > > Variable pid is defined as follow: > > pid_t pid; > > I think it's good enough to change its type to "int". I've never seen > a PID that's larger than 7 digits, so an int should always be big enough. > In any case, that's what the pid_t structure uses for the pid. Why not just cast it? > > 2008-03-07 Joel Brobecker > > * remote.c (extended_remote_attach_1): Make local variable pid an int > instead of a pid_t. > > Tested on sparc-solaris by rebuilding remote.o (I tried with both > a 32bit compiler and a 64bit compiler). > > OK to apply? > > Thanks,