From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4952 invoked by alias); 1 Jul 2014 01:11:26 -0000 Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org Received: (qmail 4865 invoked by uid 89); 1 Jul 2014 01:11:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: qmta02.emeryville.ca.mail.comcast.net Received: from qmta02.emeryville.ca.mail.comcast.net (HELO qmta02.emeryville.ca.mail.comcast.net) (76.96.30.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Jul 2014 01:11:20 +0000 Received: from omta02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by qmta02.emeryville.ca.mail.comcast.net with comcast id Lp7U1o0040QkzPwA2pBKxT; Tue, 01 Jul 2014 01:11:19 +0000 Received: from redwood.eagercon.com ([24.7.16.38]) by omta02.emeryville.ca.mail.comcast.net with comcast id LpBJ1o0040pGQcg8NpBJsv; Tue, 01 Jul 2014 01:11:18 +0000 Message-ID: <53B20AB6.6050801@eagercon.com> Date: Tue, 01 Jul 2014 01:11:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Chen Gang CC: vapier@gentoo.org, cgen@sourceware.org, binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH] sim/microblaze/interp.c: Use long int format instead of int to avoid compiling warnings References: <53B1FD76.7030500@gmail.com> <53B20430.1070500@eagercon.com> <53B209ED.4070004@gmail.com> In-Reply-To: <53B209ED.4070004@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-q3/txt/msg00003.txt.bz2 On 06/30/14 18:07, Chen Gang wrote: > On 07/01/2014 08:43 AM, Michael Eager wrote: >> On 06/30/14 17:14, Chen Gang wrote: >>> The related warnings (cross compile microblaze-linux-elf): >>> >>> ../../../binutils-gdb/sim/microblaze/interp.c: In function >>> =E2=80=98microblaze_extract_unsigned_integer=E2=80=99: >>> ../../../binutils-gdb/sim/microblaze/interp.c:53:6: warning: format >>> =E2=80=98%d=E2=80=99 expects argument of type =E2=80=98int=E2=80=99, bu= t argument 2 has type =E2=80=98long >>> unsigned int=E2=80=99 [-Wformat] >>> ../../../binutils-gdb/sim/microblaze/interp.c: In function =E2=80= =98sim_size=E2=80=99: >>> ../../../binutils-gdb/sim/microblaze/interp.c:329:4: warning: >>> format =E2=80=98%d=E2=80=99 expects argument of type =E2=80=98int=E2=80= =99, but argument 3 has type >>> =E2=80=98long unsigned int=E2=80=99 [-Wformat] >>> ../../../binutils-gdb/sim/microblaze/interp.c: In function >>> =E2=80=98set_initial_gprs=E2=80=99: >>> ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning: >>> format =E2=80=98%d=E2=80=99 expects argument of type =E2=80=98int=E2=80= =99, but argument 3 has type >>> =E2=80=98long unsigned int=E2=80=99 [-Wformat] >>> ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning: >>> format =E2=80=98%x=E2=80=99 expects argument of type =E2=80=98unsigned = int=E2=80=99, but argument 4 >>> has type =E2=80=98long unsigned int=E2=80=99 [-Wformat] >>> >>> >>> Signed-off-by: Chen Gang >>> --- >>> sim/ChangeLog | 5 +++++ >>> sim/microblaze/interp.c | 6 +++--- >>> 2 files changed, 8 insertions(+), 3 deletions(-) >>> >>> diff --git a/sim/ChangeLog b/sim/ChangeLog >>> index 35d0920..03c244b 100644 >>> --- a/sim/ChangeLog >>> +++ b/sim/ChangeLog >>> @@ -1,3 +1,8 @@ >>> +2014-07-01 Chen Gang >>> + >>> + * sim/microblaze/interp.c: Use long int format instead of int >>> + format to avoid compiling warnings. >>> + >>> 2014-03-12 Nick Clifton >>> >>> * MAINTAINERS: Add myself as the maintainer for the MSP430. >> >> Please put your ChangeLog in the email, not in a patch. > > OK, thanks. I shall notice about it next time. If necessary to send > patch v2 for it, please let me know. > >> >>> diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c >>> index cc61278..e92a1d0 100644 >>> --- a/sim/microblaze/interp.c >>> +++ b/sim/microblaze/interp.c >>> @@ -50,7 +50,7 @@ microblaze_extract_unsigned_integer (unsigned char >>> *addr, int len) >>> >>> if (len > (int) sizeof (unsigned long)) >>> printf ("That operation is not available on integers of more tha= n " >>> - "%d bytes.", sizeof (unsigned long)); >>> + "%ld bytes.", sizeof (unsigned long)); >>> >>> /* Start at the most significant end of the integer, and work towa= rds >>> the least significant. */ >>> @@ -325,7 +325,7 @@ sim_size (int size) >>> { >>> if (issue_messages) >>> fprintf (stderr, >>> - "Not enough VM for simulation of %d bytes of RAM\n", >>> + "Not enough VM for simulation of %ld bytes of RAM\n", >>> CPU.msize); >>> >>> CPU.msize =3D 1; >>> @@ -356,7 +356,7 @@ set_initial_gprs () >>> memsize =3D CPU.msize / (1024 * 1024); >>> >>> if (issue_messages > 1) >>> - fprintf (stderr, "Simulated memory of %d Mbytes (0x0 .. 0x%08x)\n", >>> + fprintf (stderr, "Simulated memory of %ld Mbytes (0x0 .. >>> 0x%08lx)\n", >>> memsize, CPU.msize - 1); >>> >>> /* Clean out the GPRs */ >> >> >> Commit ba8e7d1e2. > > Excuse me, I do not quite undersand the meaning. I guess it means: > > "have applied this patch, and its' commit number is ba8e7d1e2...", That's correct. The patch has been committed as an obvious fix. --=20 Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077