On Saturday 17 October 2009, Redirect "Slash" NIL wrote:
> >
> > The "0 +" is mutant...
> >
> 
> Yeah. The problem here is that HANDLE is typedef'd as void* (in winnt.h),
> whereas _get_osfhandle() returns a long (
> http://msdn.microsoft.com/en-us/library/ks2530z6.aspx), and gcc insists on
> returning a warning when casting a 32 bit long into a 64 bit pointer ("cast
> to pointer from integer of different size").
> The most elegant way I found to avoid that warning is to do an arithmetic
> operation first.

Linux solves that by casting first to intptr_t:

        long l = ...;
        void *p;

        p = (void *)(intptr_t) l;

That would work better with Igor's suggestion too.  Could you
send me a patch you've verified works, using that approach?

I'm sort of opposed to mutant code.  ;)

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to