-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
/home/mohit.joshi/pstress_ps/src/third_party/inih++/lib/ini.c:77:5: error: ‘__builtin_strncpy’ output may be truncated copying 49 bytes from a string of length 199 [-Werror=stringop-truncation] 77 | strncpy(dest, src, size); #104
Comments
Thanks. I will wait for you to come to a conclusion. |
That commit should fix it. Can you please verify, and if so, I'll tag a release? |
Hello, |
Details: benhoyt/inih#104 The fix has been included in pstress
Unfortunately the straight switch to memcpy introduced a "read from invalid memory" issue. Fixed with https://github.com/benhoyt/inih/releases/tag/r51 in a way that hopefully avoids the gcc warning as well. |
Hi,
I am using gcc latest version 10.1.0 and using the latest version inih (inih-r49) .
I am getting errors during make
In file included from /usr/include/string.h:633,
from /home/mohit.joshi/pstress_ps/src/third_party/inih++/lib/ini.c:20:
In function ‘strncpy0’,
inlined from ‘ini_parse_stream’ at /home/mohit.joshi/pstress_ps/src/third_party/inih++/lib/ini.c:199:17:
/home/mohit.joshi/pstress_ps/src/third_party/inih++/lib/ini.c:77:5: error: ‘__builtin_strncpy’ output may be truncated copying 49 bytes from a string of length 199 [-Werror=stringop-truncation]
77 | strncpy(dest, src, size - 1);
| ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [src/third_party/inih++/lib/CMakeFiles/inih++.dir/ini.c.o] Error 1
make[1]: *** [src/third_party/inih++/lib/CMakeFiles/inih++.dir/all] Error 2
make: *** [all] Error 2
Please fix this or suggest a work-around until this gets fixed
The text was updated successfully, but these errors were encountered: