snabb icon indicating copy to clipboard operation
snabb copied to clipboard

gcc 8.3.1 has a compile error due to the warning -Wstringop-truncation

Open jhe33 opened this issue 6 years ago • 1 comments

in file apps/vhost/vhost_user.c, line 36 and 57, the following is the code:

strncpy(un.sun_path, path, sizeof(un.sun_path));

could someone change the strncpy to memcpy to avoid the compile error or add some gcc pragmas, like:

#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-truncation" strncpy(d, s, 32); #pragma GCC diagnostic pop

jhe33 avatar Apr 08 '19 07:04 jhe33

Thanks for reporting! Could you make this a pull request with a fix please, since you know the solution, and we can merge it?

lukego avatar Apr 08 '19 08:04 lukego