Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: Jason R Thorpe <thorpej@wasabisystems.com>,
	gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Trivial printf format warning fixes
Date: Mon, 22 Apr 2002 23:20:00 -0000	[thread overview]
Message-ID: <u8g01ney1h.fsf@gromit.moeb> (raw)
In-Reply-To: <Pine.SUN.3.91.1020423100505.22959J@is> (Eli Zaretskii's message of "Tue, 23 Apr 2002 10:10:16 +0300 (IDT)")

Eli Zaretskii <eliz@is.elta.co.il> 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


  reply	other threads:[~2002-04-23  6:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-22 20:00 Jason R Thorpe
2002-04-22 23:11 ` Eli Zaretskii
2002-04-22 23:20   ` Andreas Jaeger [this message]
2002-04-23  0:01     ` Jason R Thorpe
2002-04-23  3:13       ` Eli Zaretskii
2002-04-23  8:58         ` Jason R Thorpe
2002-04-22 23:22   ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u8g01ney1h.fsf@gromit.moeb \
    --to=aj@suse.de \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=thorpej@wasabisystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox