[PATCH] c/67882 - improve -Warray-bounds for invalid offsetof

Joseph Myers joseph@codesourcery.com
Tue Oct 20 17:11:00 GMT 2015


On Tue, 20 Oct 2015, Martin Sebor wrote:

>   An array subscript is out of range, even if an object is apparently
>   accessible with the given subscript (as in the lvalue expression
>   a[1][7] given the declaration int a[4][5]) (6.5.6).

Just-past-the-end is only out of range if the dereference is executed, not 
in the &array[size] case which is equivalent to array + size.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list