Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jhe33 opened this issue Apr 8, 2019 · 1 comment
Open

Comments

@jhe33
Copy link

jhe33 commented Apr 8, 2019

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

@lukego
Copy link
Member

lukego commented Apr 8, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants