memcached 1.6.6 GCC 12 (FreeBSD 13)

GCC 12

memcached.c:1434:31: error: array subscript 'protocol_binary_request_incr[0]' is partly outside array bounds of 'char[45]' [-Werror=array-bounds]
 1434 |     req->message.body.delta = ntohll(req->message.body.delta);

workaround

cd memcached-1.6.6
./configure CFLAGS=-Wno-error=array-bounds 
make

Found a wuerg-around (err, german-IT-slang) - a work around for GCC 12.

Add this for your additions to CFLAGS (PKGBUILD / environment / Makefile):

export CFLAGS="$CFLAGS -Wno-error=array-bounds -Wno-error=address"

tvheadend now builds.

https://tvheadend.org/issues/6173https://tvheadend.org/issues/6173#note-8