[Bug middle-end/82286] Wrong array subscript is above array bounds

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 22 08:50:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82286

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|marxin at gcc dot gnu.org          |unassigned at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Looks my sample is not correct as e is global variables and may be out of
bounds of the array.

Similar to your sample:

p_input_matrix->nof_rows and p_input_matrix->nof_cols is not guaranteed to be
in range 0..MAX_MATRIX_SIZE-1. Thus both row and col may be out of bounds.
Well, the warning is not precise, word 'maybe' would be more precise in this
case.


More information about the Gcc-bugs mailing list