[PATCH] fix off-by-one mistake in -Warray-bounds for major bounds (PR 84079)

Martin Sebor msebor@gmail.com
Wed Jul 22 23:35:11 GMT 2020


-Warray-bounds fails to trigger when taking the address of an element
of a multi-dimensional array at an index that's equal to the bound of
one of the higher dimensions of the array.  The attached simple patch
corrects this shortcoming.  I will commit it tomorrow unless there are
suggestions for changes.

Tested on x86_64-linux.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-84079.diff
Type: text/x-patch
Size: 6627 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200722/5644a623/attachment.bin>


More information about the Gcc-patches mailing list