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

fix: strlcpy and strlcat redeclaration on gcc 13.3.0 #115

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

Conversation

luisschwab
Copy link

strlcpy and strlcat are being redeclared by strlcpy.h. Removing the import fixes it.

~/git/bitcoin-seeder $ make
g++ -std=c++11 -pthread -O3 -g0 -march=native -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o netbase.o netbase.cpp
In file included from netbase.cpp:13:
strlcpy.h:27:15: error: ‘size_t strlcpy(char*, const char*, size_t)’ redeclared inline without ‘gnu_inline’ attribute
   27 | inline size_t strlcpy(char *dst, const char *src, size_t siz)
      |               ^~~~~~~
In file included from /usr/include/features.h:502,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679,
                 from /usr/include/c++/13/bits/requires_hosted.h:31,
                 from /usr/include/c++/13/string:38,
                 from netbase.h:7,
                 from netbase.cpp:6:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:150:1: note: ‘size_t strlcpy(char*, const char*, size_t)’ previously defined here
  150 | __NTH (strlcpy (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~
strlcpy.h:62:15: error: ‘size_t strlcat(char*, const char*, size_t)’ redeclared inline without ‘gnu_inline’ attribute
   62 | inline size_t strlcat(char *dst, const char *src, size_t siz)
      |               ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:167:1: note: ‘size_t strlcat(char*, const char*, size_t)’ previously defined here
  167 | __NTH (strlcat (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~
make: *** [Makefile:8: netbase.o] Error 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

Successfully merging this pull request may close these issues.

1 participant