This is the mail archive of the gdb-patches@sourceware.org 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] gdbserver/win32-low.c: Fix printf-like formatting (was Re: [patch]: Replace stryoul call to fetch address)


On Feb 27 22:23, Eli Zaretskii wrote:
> > Date: Wed, 27 Feb 2013 20:50:13 +0100
> > From: Corinna Vinschen <vinschen@redhat.com>
> > 
> > @@ -1452,7 +1452,7 @@ get_child_debug_event (struct target_wai
> >      {
> >      case CREATE_THREAD_DEBUG_EVENT:
> >        OUTMSG2 (("gdbserver: kernel event CREATE_THREAD_DEBUG_EVENT "
> > -		"for pid=%d tid=%x)\n",
> > +		"for pid=%u tid=%x)\n",
> >  		(unsigned) current_event.dwProcessId,
> >  		(unsigned) current_event.dwThreadId));
> >  
> > @@ -1465,7 +1465,7 @@ get_child_debug_event (struct target_wai
> >  
> >      case EXIT_THREAD_DEBUG_EVENT:
> >        OUTMSG2 (("gdbserver: kernel event EXIT_THREAD_DEBUG_EVENT "
> > -		"for pid=%d tid=%x\n",
> > +		"for pid=%u tid=%x\n",
> >  		(unsigned) current_event.dwProcessId,
> >  		(unsigned) current_event.dwThreadId));
> >        child_delete_thread (current_event.dwProcessId,
> 
> I don't understand the need for any of these changes.  DWORD is
> already an unsigned integer type:
> 
>   typedef unsigned long DWORD;
> 
> (this is from windef.h).  So why do we need to cast it to 'unsigned'??
> What "type related warnings" did you see?

If you look closely, I didn't add the unsigned casts.  I just changed
%d to %u or %x, matching the signedness of the value.  The unsigned
casts are already widely used throughout the file.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat


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