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: [RFA] Fix cygwin32 failure introduced by [patch] windows-nat.c: Fix offset problem in signal string handling


On Mar 27 08:48, Eli Zaretskii wrote:
> > From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> > Index: windows-nat.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/windows-nat.c,v
> > retrieving revision 1.245
> > diff -u -p -r1.245 windows-nat.c
> > --- windows-nat.c       23 Mar 2013 10:48:23 -0000      1.245
> > +++ windows-nat.c       26 Mar 2013 21:39:57 -0000
> > @@ -990,7 +990,7 @@ handle_output_debug_string (struct targe
> >           retval = strtoul (p, &p, 0);
> >           if (!retval)
> >             retval = main_thread_id;
> > -         else if ((x = (LPCVOID) strtoull (p, NULL, 0))
> > +         else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
> >                    && ReadProcessMemory (current_process_handle, x,
> >                                          &saved_context,
> >                                          __COPY_CONTEXT_SIZE, &n)
> 
> Is the cast to LPCVOID really needed?  What if you drop it (and not
> add the cast to uintptr_t)?

x is a pointer, so it's 4 byte on 32 bit and 8 byte on 64 bit.  If you
drop the casts, you get the warning in the 32 bit case again.


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]