[ovs-dev] "array subscript is above array bounds" for flowmap_set(), flowmap_clear()

Ben Pfaff blp at nicira.com
Wed Aug 26 23:50:21 UTC 2015


GCC 4.9 doesn't like flowmap_clear() and flowmap_set().  Maybe that's
why you had those seemingly redundant tests in there?  I'm taking a
closer look to see whether I believe its claims though.

      CC       lib/classifier.lo
    In file included from ../lib/match.h:20:0,
                     from ../lib/classifier.h:302,
                     from ../lib/classifier.c:18:
    ../lib/classifier.c: In function 'miniflow_get_map_in_range':
    ../lib/flow.h:520:28: error: array subscript is above array bounds [-Werror=array-bounds]
             fm->bits[unit + 1] &= ~(n_bits_mask >> (MAP_T_BITS - idx));
                                ^
    ../lib/flow.h:520:28: error: array subscript is above array bounds [-Werror=array-bounds]
    cc1: all warnings being treated as errors
    Makefile:3910: recipe for target 'lib/classifier.lo' failed
    make[2]: *** [lib/classifier.lo] Error 1
      CC       lib/flow.lo
    In file included from ../lib/flow.c:18:0:
    ../lib/flow.c: In function 'miniflow_extract':
    ../lib/flow.h:502:28: error: array subscript is above array bounds [-Werror=array-bounds]
             fm->bits[unit + 1] |= n_bits_mask >> (MAP_T_BITS - idx);
                                ^
    ../lib/flow.h:502:28: error: array subscript is above array bounds [-Werror=array-bounds]
    cc1: all warnings being treated as errors



More information about the dev mailing list