From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16395 invoked by alias); 23 Apr 2002 06:20:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16373 invoked from network); 23 Apr 2002 06:20:30 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 23 Apr 2002 06:20:30 -0000 Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id 7D5F51E70C; Tue, 23 Apr 2002 08:20:30 +0200 (MEST) Received: from aj by arthur.inka.de with local (Exim 3.34 #1) id 16ztf8-0005Da-00; Tue, 23 Apr 2002 08:20:26 +0200 To: Eli Zaretskii Cc: Jason R Thorpe , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Trivial printf format warning fixes References: From: Andreas Jaeger Date: Mon, 22 Apr 2002 23:20:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Tue, 23 Apr 2002 10:10:16 +0300 (IDT)") Message-ID: User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00829.txt.bz2 Eli Zaretskii writes: > On Mon, 22 Apr 2002, Jason R Thorpe wrote: > >> error ("Syntax error at prompt position %d", >> - promptp - local_prompt); >> + (int) (promptp - local_prompt)); > > I think the result of subtracting two pointers can be wider than an int, > can't it? If so, casting to an int is not right, and the format should > be changed to %ld. ISO C99 introduced 't' for ptrdiff_t, so we could use '%td' here if we have an ISO C99 compiler. > (Yes, this is nitpicking, but if we are to fix this warning, might as > well do it right ;-) Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj