This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Trivial printf format warning fixes


   From: Eli Zaretskii <eliz@is.elta.co.il>
   Date: Tue, 23 Apr 2002 10:10:16 +0300 (IDT)

   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.
   
   (Yes, this is nitpicking, but if we are to fix this warning, might as 
   well do it right ;-)
   
Aren't there standard printf format strings for ptrdiff_t, that is
what this thing is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]