The warning is a result of upgrading GCC from 10.3 to 12.1 and it pops
up only when GCC is NOT given -O2, which happens when build.sh runs
"make -s CFLAGS=-Werror". This reproduces with both Autoconf and CMake.
NetBSD netbsd-aarch64 9.2 NetBSD 9.2 (GENERIC64) #0
gcc12 (GCC) 12.1.0
pcap-bpf.c: In function 'bpf_open':
pcap-bpf.c:529:75: error: 'snprintf' output may be truncated before the
last format character [-Werror=format-truncation=]
pcap-bpf.c:529:31: note: 'snprintf' output between 10 and 20 bytes into
a destination of size 19
(cherry picked from commit
4e7f6e838acb98d70ba7680c02cb1edd4fd8ad99)
int fd = -1;
static const char cloning_device[] = "/dev/bpf";
int n = 0;
- char device[sizeof "/dev/bpf0000000000"];
+ char device[sizeof "/dev/bpf00000000000"];
static int no_cloning_bpf = 0;
#ifdef _AIX