From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4710 invoked by alias); 4 Oct 2008 18:45:08 -0000 Received: (qmail 4691 invoked by uid 22791); 4 Oct 2008 18:45:06 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 04 Oct 2008 18:44:15 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id D630C2100F; Sat, 4 Oct 2008 11:44:13 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost5.vmware.com (Postfix) with ESMTP id CDA13DC0DB; Sat, 4 Oct 2008 11:44:13 -0700 (PDT) Message-ID: <48E7B927.9050207@vmware.com> Date: Sat, 04 Oct 2008 18:45:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , teawater Subject: [RFA record/replay] cast to avoid compiler warning Content-Type: multipart/mixed; boundary="------------060104090500040005070701" 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/msg00109.txt.bz2 This is a multi-part message in MIME format. --------------060104090500040005070701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 137 Sizeof returns size_t, which is not always the same as int. This cast will prevent compiler warnings on some architectures (eg. x86_64) --------------060104090500040005070701 Content-Type: text/plain; name="sizeof.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sizeof.txt" Content-length: 4728 2008-10-03 Michael Snyder * linux-record.c (record_linux_system_call): Cast sizeof to int 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 3 Oct 2008 23:04:20 -0000 @@ -597,7 +597,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (sel)); + paddr_nz (tmpu32), (int) sizeof (sel)); return (-1); } if (record_arch_list_add_mem (sel.inp, tdep->size_fd_set)) @@ -749,7 +749,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (record_arch_list_add_mem (a[1], tdep->size_sockaddr)) @@ -775,7 +775,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (record_arch_list_add_mem (a[3], tdep->size_int)) @@ -799,7 +799,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (a[2]) @@ -809,7 +809,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (a[2]), sizeof (a[2])); + paddr_nz (a[2]), (int) sizeof (a[2])); return (-1); } if (record_arch_list_add_mem (a[1], a[2])) @@ -831,7 +831,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (a[2]) @@ -841,7 +841,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (a[2]), sizeof (a[2])); + paddr_nz (a[2]), (int) sizeof (a[2])); return (-1); } if (record_arch_list_add_mem (a[1], a[2])) @@ -876,7 +876,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (a[4]) @@ -886,7 +886,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (a[4]), sizeof (av)); + paddr_nz (a[4]), (int) sizeof (av)); return (-1); } if (record_arch_list_add_mem (a[3], av)) @@ -930,7 +930,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (tmpu32), sizeof (a)); + paddr_nz (tmpu32), (int) sizeof (a)); return (-1); } if (record_arch_list_add_mem (a[1], tdep->size_msghdr)) @@ -944,7 +944,7 @@ record_linux_system_call (int num, linux { fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", - paddr_nz (a[1]), sizeof (rec)); + paddr_nz (a[1]), (int) sizeof (rec)); return (-1); } if (record_arch_list_add_mem @@ -968,7 +968,7 @@ record_linux_system_call (int num, linux fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", paddr_nz (rec.msg_iov), - sizeof (iov)); + (int) sizeof (iov)); return (-1); } if (record_arch_list_add_mem @@ -1336,7 +1336,7 @@ record_linux_system_call (int num, linux fprintf_unfiltered (gdb_stdlog, "Record: read memory addr = 0x%s len = %d error.\n", paddr_nz (vec), - sizeof (struct record_iovec)); + (int) sizeof (struct record_iovec)); return (-1); } if (record_arch_list_add_mem (iov.iov_base, iov.iov_len)) --------------060104090500040005070701--