Our focal package build for Ubuntu ppc64el is failing with:
gcc -DHAVE_CONFIG_H -I. -I../include -I../include -I../include/rs_vand -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -Werror -D_GNU_SOURCE=1 -Wall -pedantic -std=c99 -g -O3 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DARCH_64 -c -o builtin/rs_vand/liberasurecode_rs_vand_test-liberasurecode_rs_vand_test.o `test -f 'builtin/rs_vand/liberasurecode_rs_vand_test.c' || echo './'`builtin/rs_vand/liberasurecode_rs_vand_test.c
In file included from /usr/include/string.h:494,
from ../include/erasurecode/erasurecode_stdinc.h:67,
from ../include/erasurecode/erasurecode.h:32,
from liberasurecode_test.c:32:
In function ‘strncpy’,
inlined from ‘create_fake_frags_no_meta’ at liberasurecode_test.c:408:9,
inlined from ‘test_decode_invalid_args’ at liberasurecode_test.c:699:23:
/usr/include/powerpc64le-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output truncated before terminating nul copying 1 byte from a string of the same length [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With -Werror=format-security,-Werror=stringop-truncation gets set. -Werror=stringop-truncation will fail the build, in this case because strncpy is copying a string but not copying the string's null terminator (ie. it's only copying one byte of " "). The actual error is occurring in create_fake_frags_no_meta at liberasurecode_test.c:408, but I think it can be fixed in test_decode_invalid_args at liberasurecode_test.c:699.
https:/ /review. opendev. org/#/c/ 702530/