ODP build fails with GCC 10.1
jerinjacobk opened this issue · comments
GCC 10 is available in Fedora 32 or Archlinux.
Log:
CC odp_schedule_basic.lo
In file included from ../../platform/linux-generic/include/odp_ring_u32_internal.h:19,
from odp_schedule_basic.c:25:
odp_schedule_basic.c: In function ‘schedule_term_global’:
../../platform/linux-generic/include/odp_ring_internal.h:133:20: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
133 | *data = ring->data[new_head & mask];
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
odp_schedule_basic.c: In function ‘schedule_pktio_start’:
../../platform/linux-generic/include/odp_ring_internal.h:207:12: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
207 | ring->data[new_head & mask] = data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
odp_schedule_basic.c: In function ‘schedule_sched_queue’:
../../platform/linux-generic/include/odp_ring_internal.h:207:12: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
207 | ring->data[new_head & mask] = data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
odp_schedule_basic.c: In function ‘do_schedule’:
../../platform/linux-generic/include/odp_ring_internal.h:133:20: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
133 | *data = ring->data[new_head & mask];
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
../../platform/linux-generic/include/odp_ring_internal.h:207:12: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
207 | ring->data[new_head & mask] = data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
../../platform/linux-generic/include/odp_ring_internal.h:207:12: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
207 | ring->data[new_head & mask] = data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
../../platform/linux-generic/include/odp_ring_internal.h:207:12: error: array subscript ‘’ is outside the bounds of an interior zero-length array ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=zero-length-bounds]
207 | ring->data[new_head & mask] = data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../platform/linux-generic/include/odp_ring_internal.h:48:11: note: while referencing ‘data’
48 | uint32_t data[0];
| ^~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:1339: odp_schedule_basic.lo] Error 1
We should add GCC-10 build to Travis to catch these. Ubuntu 20.04 also has gcc-10 package available and we are already running it in CI.