[PATCH 5/5] extend -Warray-bounds to detect out-of-bounds accesses to array parameters

Martin Sebor msebor@gmail.com
Wed Jul 29 01:24:10 GMT 2020


Patch 5 adds support for -Warray-bounds to detect out of bounds accesses
in functions that take array/VLA arguments.  The changes also enable
the warning for dynamically allocated memory and with it the detection
of accesses that are only partially out of bounds (e.g., accessing
a four byte int in the last two bytes of a buffer).  In hindsight this
seems independent of the attribute access enhancement so I suppose it
could have been split up into a separate change but I doubt it would
reduce the size of the diff by more than 30 lines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-50584-5.diff
Type: text/x-patch
Size: 42546 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200728/a4dc8c4c/attachment-0001.bin>


More information about the Gcc-patches mailing list