There are two zero-length arrays used, in struct
isns_hdr and struct isns_tlv, that are really meant
as place-holders for allocated arrays. These need
to be declared as empty arrays instead of zero-
length arrays, since this is the accepted way
of handling such data these days.
This fixes a gcc-10 warning that looks like:
In function ‘isns_rsp_handle’,
inlined from ‘isns_handle’ at .../src/isns.c:789:3:
.../src/isns.c:724:34: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
724 | ((char ) tlv->value + slen) = '\0';
| ^
.../src/isns.c: In function ‘isns_handle’:
.../src/isns_proto.h:33:11: note: at offset 0 to object ‘value’ with size 0 declared here
33 | uint32_t value[0];
| ^
There are two zero-length arrays used, in struct isns_hdr and struct isns_tlv, that are really meant as place-holders for allocated arrays. These need to be declared as empty arrays instead of zero- length arrays, since this is the accepted way of handling such data these days.
This fixes a gcc-10 warning that looks like:
In function ‘isns_rsp_handle’, inlined from ‘isns_handle’ at .../src/isns.c:789:3: .../src/isns.c:724:34: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 724 | ((char ) tlv->value + slen) = '\0'; | ^ .../src/isns.c: In function ‘isns_handle’: .../src/isns_proto.h:33:11: note: at offset 0 to object ‘value’ with size 0 declared here 33 | uint32_t value[0]; | ^