On Tue, Sep 7, 2010 at 6:28 AM, Øyvind Harboe <[email protected]> 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.
Best Regards,
Antonio Borneo
diff --git a/src/flash/mflash.c b/src/flash/mflash.c
index 4372128..e0bb155 100644
--- a/src/flash/mflash.c
+++ b/src/flash/mflash.c
@@ -1114,16 +1114,16 @@ static void mg_gen_ataid(mg_io_type_drv_info
*pSegIdDrvInfo)
static int mg_storage_config(void)
{
- uint8_t buff[512];
+ mg_io_type_drv_info buff; /* sizeof() == 512 */
int ret;
if ((ret = mg_set_feature(mg_feature_id_transmode,
mg_feature_val_trans_vcmd))
!= ERROR_OK)
return ret;
- mg_gen_ataid((mg_io_type_drv_info *)buff);
+ mg_gen_ataid(&buff);
- if ((ret = mg_mflash_do_write_sects(buff, 0, 1,
mg_vcmd_update_stgdrvinfo))
+ if ((ret = mg_mflash_do_write_sects(&buff, 0, 1,
mg_vcmd_update_stgdrvinfo))
!= ERROR_OK)
return ret;
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development