SpinalHDL / openocd_riscv

Spen's Official OpenOCD Mirror
Other
45 stars 33 forks source link

Compiling error #6

Open pagdot opened 5 years ago

pagdot commented 5 years ago

When compiling, i get following error:

In function ‘mg_gen_ataid’,
    inlined from ‘mg_storage_config’ at src/flash/mflash.c:1174:2:
src/flash/mflash.c:1162:2: error: ‘memset’ offset [509, 512] from the object at ‘buff’ is out of the bounds of referenced subobject ‘reserved7’ with type ‘mg_io_uint8[186]’ {aka ‘unsigned char[186]’} at offset 322 [-Werror=array-bounds]
 1162 |  memset(pSegIdDrvInfo->reserved7, 0x00, 190);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems like 190 byte should be set to 0, but there are only 186 available

Dolu1990 commented 5 years ago

ahh weird, never touched that file, it is probalby due to the last GCC updates Probably merging the main openocd repo would fix the issue. Would you like to try ?

MarekPikula commented 4 years ago

The flash driver was removed from upstream on 19.06.2019 (https://sourceforge.net/p/openocd/code/ci/7a93c9e087b7cb0444068a3deb506eb127f758f0/).

MarekPikula commented 4 years ago

Also when I tried to compile it under MinGW last time there were numerous problems, which already have been fixed upstream, so I guess merging upstream version would be advised.

MarekPikula commented 4 years ago

Besides @pagdot, a quick fix for this is just to replace 190 with 186. This module is not used for VexRiscv anyway.