From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6497 invoked by alias); 5 Oct 2008 07:12:12 -0000 Received: (qmail 6489 invoked by uid 22791); 5 Oct 2008 07:12:11 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 05 Oct 2008 07:11:31 +0000 Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4CFB345B0D; Sun, 5 Oct 2008 09:11:28 +0200 (CEST) From: Andreas Schwab To: Mark Kettenis Cc: msnyder@vmware.com, gdb-patches@sourceware.org, teawater@gmail.com Subject: Re: [RFA record/replay] cast to avoid compiler warning References: <48E7B927.9050207@vmware.com> <200810042152.m94LqN1R018675@brahms.sibelius.xs4all.nl> X-Yow: Yow! Those people look exactly like Donnie and Marie Osmond!! Date: Sun, 05 Oct 2008 07:12:00 -0000 In-Reply-To: <200810042152.m94LqN1R018675@brahms.sibelius.xs4all.nl> (Mark Kettenis's message of "Sat, 4 Oct 2008 23:52:24 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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/msg00124.txt.bz2 Mark Kettenis writes: >> 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. The value will always be a small number. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."