[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|msebor at gcc dot

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #13 from Martin Sebor --- The patch submitted (but not approved) for GCC 11: https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558775.html

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2022-01-10 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #14 from Martin Sebor --- Created attachment 52156 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52156&action=edit Updated patch. The attached patch is an updated version that fixes a few ICEs. It's not in the archives becaus

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 Martin Sebor changed: What|Removed |Added Status|WAITING |NEW CC|

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-22 Thread vincent-gcc at vinc17 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #6 from Vincent Lefèvre --- bar_aux can be any function. It doesn't need to do any thing. As soon as p[1] is evaluated, one has undefined behavior, just like in function foo.

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-25 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 Alexander Cherepanov changed: What|Removed |Added CC||ch3root at openwall dot com --- C

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #8 from Martin Sebor --- In int i[4]; int (*p)[4] = &i; bar_aux (p[1]); p[0] points to i and p[1] to (char*)&i + sizeof (i) (which is the same as &i[4]). The latter is a pointer just past the end of i. Evaluating past-the-en

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-26 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #9 from Alexander Cherepanov --- (In reply to Martin Sebor from comment #8) > In > > int i[4]; > int (*p)[4] = &i; > bar_aux (p[1]); > > p[0] points to i and p[1] to (char*)&i + sizeof (i) (which is the same as > &i[4]). It s

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-02-26 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #10 from Martin Sebor --- An array is implicitly converted to a pointer; it's not an lvalue. But I think we're splitting hairs. I agree we want a warning for passing past-the-end pointers to functions that might inadvertently derefe

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-03-01 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 --- Comment #11 from Alexander Cherepanov --- (In reply to Martin Sebor from comment #10) > An array is implicitly converted to a pointer; Sometimes converted, sometimes -- not. > it's not an lvalue. Why not? Take for example p[1] that we d

[Bug middle-end/93848] missing -Warray-bounds warning for array subscript 1 is outside array bounds

2020-11-11 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93848 Martin Sebor changed: What|Removed |Added Keywords||patch Assignee|unassigned at gc