keirf / amiga-stuff

The Unlicense
259 stars 26 forks source link

ATK - compile-error memcheck (memory.c) #24

Closed fook42 closed 4 years ago

fook42 commented 4 years ago

Hello, i'm facing this problem; during compile of testkit i get this error:

CC memory.o memory.c: In function ‘memcheck’: memory.c:401:18: error: array subscript [131072, 6946816] is outside array bounds of ‘char[80]’ [-Werror=array-bounds] 401 | p[1<<17] = 0xaaaa; | ~~~~~~~~~^~~~~~~~ memory.c:348:10: note: while referencing ‘s’ 348 | char s[80]; | ^

latest git release (3433c4b0*) - but i have to say, i'm using gcc version 9.2.0. maybe this issue is only due to this new compiler, but i seams that the code is somewhat "not correct", i guess?

fook42 commented 4 years ago

addition:

in line 399: p = (volatile uint16_t *)s + (i << 18); s is not used correctly ... i guess this must be a typo, as in line 378 the same addressing is used with s=0 p = (volatile uint16_t *)0 + (i << 18);

same is true for line 407..

s is pointing to a char-array holding the output text for onscreen information.

may be fixed with pull-request: #25

keirf commented 4 years ago

Hmm I will have a look tomorrow 😊