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

Warning / error compiling on Ubunut 19.10 #90

Closed
jcorporation opened this issue Nov 8, 2019 · 2 comments
Closed

Warning / error compiling on Ubunut 19.10 #90

jcorporation opened this issue Nov 8, 2019 · 2 comments

Comments

@jcorporation
Copy link

In function ‘strncpy’,
    inlined from ‘ini_parse_stream’ at /myMPD/dist/src/inih/ini.c:77:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 49 bytes from a string of length 199 [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

I am compiling with -Wall -Werror

@benhoyt
Copy link
Owner

benhoyt commented Nov 8, 2019

Thanks for the report @jcorporation. However, I'm using the correct size here, so I think this is a false positive and not a bug in inih. What version of gcc is this? This SO answer seems to indicate it's a false positive / bug in GCC 9.

@jcorporation
Copy link
Author

jcorporation commented Nov 8, 2019

gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)

Thanks for your fast response.

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