[Bug middle-end/99578] [11/12 Regression] gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a pointer from integer literal
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 16 21:15:22 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
--- Comment #31 from Martin Sebor <msebor at gcc dot gnu.org> ---
I suppose we could move this warning under level 2 until this is handled
better. -Warray-bounds already has two levels with level 2 being more noisy,
and it might be useful to add a level to -Wstringop-overread as well.
As I mentioned in comment #25 and elsewhere, I envisioned that code would
annotate these hardwired addresses somehow, ideally using an attribute like
addr or the Keil compiler's at (see below), or until one is added, using a
workaround like your absolute_pointer(). I realize it means work, but I
believe with the attribute the gain in type safety would make it worthwhile.
Is that something the kernel developers could be trained to start using? (In
full disclosure, I don't expect to have the cycles to work on the attribute
anytime soon.)
https://www.keil.com/support/man/docs/armcc/armcc_chr1359124981140.htm
More information about the Gcc-bugs
mailing list