On Thu, Jul 7, 2011 at 11:58 AM, Øyvind Harboe <[email protected]> wrote:
> Note that this problem has cropped up many places over the OpenOCD
> code. I'd like to get rid of it once and for all....
>
> I absolutely intend to fix it for MIPS, but I'd like a good long term 
> solution.
>
> With jtag queue callbacks, a user data pointer to the callback is cast to
> a void pointer, then cast back to e.g. uint32_t *. Casting to/from void *
> does not yield a warning(should not anyway, right?),
Why shouldn't it ? I mean, you can have unaligned acces by casting
void* to unaligned addr to uint32* and then reference, right ?

> but casting from
> uint8_t * to uint32_t * is dubious because the code does not clearly
> state it's assumptions.

>From my point of view casting uint8_t* to uint32* is dangerous as
casting void* to uint32_t*. Isee no difference, as void* can point to
unaligned addr.

BR,
Drasko
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to