Re: [PATCH v2 bpf] libbpf: silence GCC8 warning about string truncation

2019-07-25 Thread Alexei Starovoitov
On Wed, Jul 24, 2019 at 10:46 PM Andrii Nakryiko wrote: > > Despite a proper NULL-termination after strncpy(..., ..., IFNAMSIZ - 1), > GCC8 still complains about *expected* string truncation: > > xsk.c:330:2: error: 'strncpy' output may be truncated copying 15 bytes > from a string of length 1

[PATCH v2 bpf] libbpf: silence GCC8 warning about string truncation

2019-07-24 Thread Andrii Nakryiko
Despite a proper NULL-termination after strncpy(..., ..., IFNAMSIZ - 1), GCC8 still complains about *expected* string truncation: xsk.c:330:2: error: 'strncpy' output may be truncated copying 15 bytes from a string of length 15 [-Werror=stringop-truncation] strncpy(ifr.ifr_name, xsk->ifnam