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

specified bound depends on the length of the source argument [-Wstringop-overflow=] #21

Open
asarubbo opened this issue Aug 12, 2021 · 0 comments

Comments

@asarubbo
Copy link

By compiling the current master code with -O2 I get:

In file included from /usr/include/string.h:519,
                 from sdm120c.c:39:
In function 'strncpy',
    inlined from 'getPIDcmd' at sdm120c.c:822:9:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |       __glibc_objsize (__dest));
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~
sdm120c.c: In function 'getPIDcmd':
sdm120c.c:820:12: note: length computed here
  820 |     cmdLen=strlen(buffer)+1;
      |            ^~~~~~~~~~~~~~
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

1 participant