On Tue, Sep 7, 2010 at 5:19 AM, Antonio Borneo <borneo.anto...@gmail.com> wrote:
> On Tue, Sep 7, 2010 at 6:28 AM, Øyvind Harboe <oyvind.har...@zylin.com> wrote:
>> These warnings are for architectures that do not
>> support non-aligned word access.
>
> Hello Øyvind,
>
> I personally do not like such approach to silent compiler warnings.
> Passing through a (void *) removes any compiler check, opening the
> door for hard to find future bugs.
>
> Why not reviewing the code in a better way, sometimes through "union"?
> Below a suggestion (not tested) aimed to replace the first few lines
> of your patch.

There are a few places where a cast to void is appropriate I think.

Especially where the callback code is passing in a pointer to
a 32 bit integer and assumes that it can be used as storage for
a 4 byte array and the API just doesn't allow for types to
be "pushed through" to the callback.

Otherwise, I'll happily accept patches that improve upon my
brute force approach. When such patches stop appearing, I
think I'll push through the rest of the patch.

The other advantage of casting to void * is that there is less
chance of *changing* the code unintentionally...

Should I apply your first patch?


-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to