[Bug c/106526] New: array-bounds warning on constant pointer dereferencing

2022-08-04 Thread wrenger at sra dot uni-hannover.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106526 Bug ID: 106526 Summary: array-bounds warning on constant pointer dereferencing Product: gcc Version: 12.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Co

[Bug c/106526] array-bounds warning on constant pointer dereferencing

2022-08-04 Thread wrenger at sra dot uni-hannover.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106526 --- Comment #1 from Lars Wrenger --- Same on C++: https://godbolt.org/z/7do3zhavf

[Bug c/106526] array-bounds warning on constant pointer dereferencing

2022-08-04 Thread wrenger at sra dot uni-hannover.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106526 --- Comment #3 from Lars Wrenger --- The array-bounds warning itself is nice. In most cases, it is good if the compiler can find invalid memory accesses. However, the wording of the warning is confusing. Strictly speaking, we are not accessing a