[Bug target/105523] Wrong warning array subscript [0] is outside array bounds
klaus.doldinger64 at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Mon May 9 06:59:55 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
--- Comment #4 from Wilhelm M <klaus.doldinger64 at googlemail dot com> ---
The strange thing is, that it depends on how the assignment is written:
#include <avr/io.h>
int main() {
GPIOR0 = 0x01; // no warning
(*(volatile uint8_t *)(0x001C)) = 0x01; // warning
}
The cpp replaces the GPIOR0 access to essentially the same line as the
following line, where the warning occures.
More information about the Gcc-bugs
mailing list