From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30430 invoked by alias); 6 Oct 2008 07:29:38 -0000 Received: (qmail 30421 invoked by uid 22791); 6 Oct 2008 07:29:36 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.186) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Oct 2008 07:29:01 +0000 Received: by ti-out-0910.google.com with SMTP id d10so1650235tib.12 for ; Mon, 06 Oct 2008 00:28:58 -0700 (PDT) Received: by 10.110.11.7 with SMTP id 7mr392432tik.23.1223278138430; Mon, 06 Oct 2008 00:28:58 -0700 (PDT) Received: by 10.110.42.9 with HTTP; Mon, 6 Oct 2008 00:28:58 -0700 (PDT) Message-ID: Date: Mon, 06 Oct 2008 07:29:00 -0000 From: teawater To: "Michael Snyder" Subject: Re: [RFA record/replay] cast to avoid compiler warning Cc: "Eli Zaretskii" , "mark@klomp.org" , "mark.kettenis@xs4all.nl" , "gdb-patches@sourceware.org" In-Reply-To: <48E92487.1@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48E7B927.9050207@vmware.com> <09B97D2C4B49DF409E2D018999AC6FE115B42A89C4@PA-EXMBX14.vmware.com> <20081005160411.GA29968@caradoc.them.org> <48E906B5.8070600@vmware.com> <48E92487.1@vmware.com> 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-10/txt/msg00144.txt.bz2 It's OK for me. BTW thanks everybody. :) On Mon, Oct 6, 2008 at 04:33, Michael Snyder wrote: > Eli Zaretskii wrote: >>> >>> Date: Sun, 05 Oct 2008 11:25:57 -0700 >>> From: Michael Snyder >>> >>> OK. So, would you favor using the "%zd" modifier instead of a cast? >> >> What's wrong with casting to "unsigned long" and using %lu? > > I know when to give up! ;-) > > Like this, then: > > > > 2008-10-03 Michael Snyder > > * linux-record.c (record_linux_system_call): Cast sizeof > in printf calls, avoid compiler warnings on 64 bit hosts. > > Index: linux-record.c > =================================================================== > RCS file: /cvs/src/src/gdb/Attic/linux-record.c,v > retrieving revision 1.1.2.4 > diff -u -p -r1.1.2.4 linux-record.c > --- linux-record.c 7 Sep 2008 01:40:43 -0000 1.1.2.4 > +++ linux-record.c 5 Oct 2008 20:33:21 -0000 > @@ -596,8 +596,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) & sel, sizeof > (sel))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len = > %d error.\n", > - paddr_nz (tmpu32), sizeof (sel)); > + "Record: read memory addr = 0x%s len = > %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (sel)); > return (-1); > } > if (record_arch_list_add_mem (sel.inp, tdep->size_fd_set)) > @@ -748,8 +748,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (record_arch_list_add_mem (a[1], tdep->size_sockaddr)) > @@ -774,8 +774,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (record_arch_list_add_mem (a[3], tdep->size_int)) > @@ -798,8 +798,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (a[2]) > @@ -808,8 +808,8 @@ record_linux_system_call (int num, linux > (a[2], (gdb_byte *) & (a[2]), sizeof (a[2]))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s > len = %d error.\n", > - paddr_nz (a[2]), sizeof (a[2])); > + "Record: read memory addr = 0x%s > len = %lu error.\n", > + paddr_nz (a[2]), (unsigned long) > sizeof (a[2])); > return (-1); > } > if (record_arch_list_add_mem (a[1], a[2])) > @@ -830,8 +830,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (a[2]) > @@ -840,8 +840,8 @@ record_linux_system_call (int num, linux > (a[2], (gdb_byte *) & (a[2]), sizeof (a[2]))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s > len = %d error.\n", > - paddr_nz (a[2]), sizeof (a[2])); > + "Record: read memory addr = 0x%s > len = %lu error.\n", > + paddr_nz (a[2]), (unsigned long) > sizeof (a[2])); > return (-1); > } > if (record_arch_list_add_mem (a[1], a[2])) > @@ -875,8 +875,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (a[4]) > @@ -885,8 +885,8 @@ record_linux_system_call (int num, linux > (a[4], (gdb_byte *) & av, sizeof (av))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s > len = %d error.\n", > - paddr_nz (a[4]), sizeof (av)); > + "Record: read memory addr = 0x%s > len = %lu error.\n", > + paddr_nz (a[4]), (unsigned long) > sizeof (av)); > return (-1); > } > if (record_arch_list_add_mem (a[3], av)) > @@ -929,8 +929,8 @@ record_linux_system_call (int num, linux > if (target_read_memory (tmpu32, (gdb_byte *) a, sizeof (a))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > - paddr_nz (tmpu32), sizeof (a)); > + "Record: read memory addr = 0x%s len > = %lu error.\n", > + paddr_nz (tmpu32), (unsigned long) > sizeof (a)); > return (-1); > } > if (record_arch_list_add_mem (a[1], tdep->size_msghdr)) > @@ -943,8 +943,8 @@ record_linux_system_call (int num, linux > (a[1], (gdb_byte *) & rec, sizeof (rec))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s > len = %d error.\n", > - paddr_nz (a[1]), sizeof (rec)); > + "Record: read memory addr = 0x%s > len = %lu error.\n", > + paddr_nz (a[1]), (unsigned long) > sizeof (rec)); > return (-1); > } > if (record_arch_list_add_mem > @@ -966,9 +966,9 @@ record_linux_system_call (int num, linux > sizeof (iov))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory > addr = 0x%s len = %d error.\n", > + "Record: read memory > addr = 0x%s len = %lu error.\n", > paddr_nz (rec.msg_iov), > - sizeof (iov)); > + (unsigned long) sizeof > (iov)); > return (-1); > } > if (record_arch_list_add_mem > @@ -1334,9 +1334,9 @@ record_linux_system_call (int num, linux > (vec, (gdb_byte *) & iov, sizeof (struct record_iovec))) > { > fprintf_unfiltered (gdb_stdlog, > - "Record: read memory addr = 0x%s len > = %d error.\n", > + "Record: read memory addr = 0x%s len > = %lu error.\n", > paddr_nz (vec), > - sizeof (struct record_iovec)); > + (unsigned long) sizeof (struct > record_iovec)); > return (-1); > } > if (record_arch_list_add_mem (iov.iov_base, iov.iov_len)) > >