This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] sim/microblaze/interp.c: Use long int format instead of int to avoid compiling warnings
- From: Chen Gang <gang dot chen dot 5i5j at gmail dot com>
- To: Michael Eager <eager at eagercon dot com>
- Cc: vapier at gentoo dot org, cgen at sourceware dot org, binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Tue, 01 Jul 2014 09:07:57 +0800
- Subject: Re: [PATCH] sim/microblaze/interp.c: Use long int format instead of int to avoid compiling warnings
- Authentication-results: sourceware.org; auth=none
- References: <53B1FD76 dot 7030500 at gmail dot com> <53B20430 dot 1070500 at eagercon dot com>
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
>> âmicroblaze_extract_unsigned_integerâ:
>> ../../../binutils-gdb/sim/microblaze/interp.c:53:6: warning: format
>> â%dâ expects argument of type âintâ, but argument 2 has type âlong
>> unsigned intâ [-Wformat]
>> ../../../binutils-gdb/sim/microblaze/interp.c: In function âsim_sizeâ:
>> ../../../binutils-gdb/sim/microblaze/interp.c:329:4: warning:
>> format â%dâ expects argument of type âintâ, but argument 3 has type
>> âlong unsigned intâ [-Wformat]
>> ../../../binutils-gdb/sim/microblaze/interp.c: In function
>> âset_initial_gprsâ:
>> ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning:
>> format â%dâ expects argument of type âintâ, but argument 3 has type
>> âlong unsigned intâ [-Wformat]
>> ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning:
>> format â%xâ expects argument of type âunsigned intâ, but argument 4
>> has type âlong unsigned intâ [-Wformat]
>>
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>> 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 <gang.chen.5i5j@gmail.com>
>> +
>> + * sim/microblaze/interp.c: Use long int format instead of int
>> + format to avoid compiling warnings.
>> +
>> 2014-03-12 Nick Clifton <nickc@redhat.com>
>>
>> * 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 than "
>> - "%d bytes.", sizeof (unsigned long));
>> + "%ld bytes.", sizeof (unsigned long));
>>
>> /* Start at the most significant end of the integer, and work towards
>> 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 = 1;
>> @@ -356,7 +356,7 @@ set_initial_gprs ()
>> memsize = 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...",
If what I guess is incorrect, please let me know, and I shall send patch
v2 for it.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed