From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31454 invoked by alias); 5 Oct 2008 15:47:04 -0000 Received: (qmail 31443 invoked by uid 22791); 5 Oct 2008 15:47:04 -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; Sun, 05 Oct 2008 15:46:08 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 2648E4A002; Sun, 5 Oct 2008 08:46:07 -0700 (PDT) Received: from pa-excaht04.vmware.com (pa-excaht04.vmware.com [10.113.81.155]) by mailhost5.vmware.com (Postfix) with ESMTP id 16279DC07E; Sun, 5 Oct 2008 08:46:07 -0700 (PDT) Received: from pa-excaht12.vmware.com (10.113.81.205) by pa-excaht04.vmware.com (10.113.81.155) with Microsoft SMTP Server (TLS) id 8.1.263.0; Sun, 5 Oct 2008 08:46:07 -0700 Received: from PA-EXMBX14.vmware.com ([10.113.81.216]) by pa-excaht12.vmware.com ([10.113.81.205]) with mapi; Sun, 5 Oct 2008 08:46:06 -0700 From: Michael Snyder To: Mark Wielaard , Mark Kettenis CC: "gdb-patches@sourceware.org" , "teawater@gmail.com" Date: Sun, 05 Oct 2008 15:47:00 -0000 Subject: RE: [RFA record/replay] cast to avoid compiler warning Message-ID: <09B97D2C4B49DF409E2D018999AC6FE115B42A89C4@PA-EXMBX14.vmware.com> References: <48E7B927.9050207@vmware.com> <200810042152.m94LqN1R018675@brahms.sibelius.xs4all.nl>,<1223208994.3267.31.camel@dijkstra.wildebeest.org> In-Reply-To: <1223208994.3267.31.camel@dijkstra.wildebeest.org> Accept-Language: en-US Content-Language: en-US acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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/msg00129.txt.bz2 Yes, but we don't know that gdb will always be built using gnulib. Mark, I recognize your objection, and I'll change it with some reluctance, but I really think you're making too big a deal out of it... ________________________________________ From: gdb-patches-owner@sourceware.org [gdb-patches-owner@sourceware.org] O= n Behalf Of Mark Wielaard [mark@klomp.org] Sent: Sunday, October 05, 2008 5:16 AM To: Mark Kettenis Cc: Michael Snyder; gdb-patches@sourceware.org; teawater@gmail.com Subject: Re: [RFA record/replay] cast to avoid compiler warning On Sat, 2008-10-04 at 23:52 +0200, Mark Kettenis wrote: > > Date: Sat, 04 Oct 2008 11:42:47 -0700 > > From: Michael Snyder > > > > Sizeof returns size_t, which is not always the same as int. > > This cast will prevent compiler warnings on some architectures > > (eg. x86_64) > > This is wrong! Better cast to unsigned long and print as %lu. > > There is a C99 way to do this, but not all systems implement it properly. gnulib provides a posix compatible printf that understands %z for size_t: http://www.gnu.org/software/gnulib/manual/html_node/printf.html Cheers, Mark