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

Avoid gcc 11 strncpy warning #4

Open
wants to merge 1 commit into
base: fuse_2_9_5_customize_multi_threads
Choose a base branch
from

Conversation

jasondrogba
Copy link

reference: libfuse#447
running make -j8 have warning:

In file included from /usr/include/string.h:535,
                 from fuse.c:23:
In function 'strncpy',
    inlined from 'add_name' at fuse.c:908:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
fuse.c: In function 'add_name':
fuse.c:884:22: note: length computed here
  884 |         size_t len = strlen(name);
      |                      ^~~~~~~~~~~~
In file included from /usr/include/string.h:535,
                 from fuse_lowlevel.c:22:
In function 'strncpy',
    inlined from 'fuse_add_dirent' at fuse_lowlevel.c:263:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
fuse_lowlevel.c: In function 'fuse_add_dirent':
fuse_lowlevel.c:253:28: note: length computed here
  253 |         unsigned namelen = strlen(name);
      |                            ^~~~~~~~~~~~
  CC       mount_util.lo
  CC       ulockmgr.lo

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

Successfully merging this pull request may close these issues.

1 participant