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

Unable to compile source code in Debian sid (clang 16.0.6) #135

Open
holishing opened this issue Sep 1, 2024 · 1 comment
Open

Unable to compile source code in Debian sid (clang 16.0.6) #135

holishing opened this issue Sep 1, 2024 · 1 comment

Comments

@holishing
Copy link
Contributor

Just add a memo (from bbsdocker/imageptt#8 ).
If someday I find a solution, I will share here and perhaps add a PR about this.

https://github.com/bbsdocker/imageptt/actions/runs/9700365062/job/26771584227

#19 56.05 In file included from mergedir2.cc:7:
#19 56.05 In file included from ../include/bbs.h:13:
#19 56.05 /usr/include/string.h:506:15: error: exception specification in declaration does not match previous declaration
#19 56.05 extern size_t strlcpy (char *__restrict __dest,
#19 56.05               ^
#19 56.05 ../include/osdep.h:33:8: note: previous declaration is here
#19 56.05 size_t strlcpy(char *dst, const char *src, size_t size);
#19 56.05        ^
#19 56.05 In file included from mergedir2.cc:7:
#19 56.05 In file included from ../include/bbs.h:13:
#19 56.05 /usr/include/string.h:512:15: error: exception specification in declaration does not match previous declaration
#19 56.05 extern size_t strlcat (char *__restrict __dest,
#19 56.05               ^
#19 56.05 ../include/osdep.h:37:8: note: previous declaration is here
#19 56.05 size_t strlcat(char *dst, const char *src, size_t size);
#19 56.05        ^
#19 56.15 2 errors generated.
#19 56.16 *** Error code 1
#19 56.16 
#19 56.16 Stop.
#19 56.16 bmake[1]: stopped in /home/bbs/pttbbs/util
#19 56.16 *** Error code 1
@holishing holishing changed the title unable to compile source code in Debian sid (clang 16.0.6) Unable to compile source code in Debian sid (clang 16.0.6) Sep 1, 2024
@IepIweidieng
Copy link
Contributor

IepIweidieng commented Sep 1, 2024

The assumption of strlcpy() & strlcat() being nonexistent on Linux is broken on your Linux distribution version.

pttbbs/include/osdep.h

Lines 12 to 24 in c4f6a29

#ifdef __linux__
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* for strcasestr */
#endif
#include <sys/ioctl.h>
#include <sys/file.h> /* for flock() */
#include <strings.h> /* for strcasecmp() */
#define NEED_STRLCPY
#define NEED_STRLCAT
#define NEED_SETPROCTITLE

Maybe an actual test for the existence of a certain system function is needed, which can be achieved by, e.g., compiling and linking a test program without the BBS library to see whether there are any undefined references.

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