Error then compiling with clang
opened this issue · comments
src/server.c:1308:7: error: call to undeclared function 'getdomainname'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (getdomainname(domainname, 127) == 0 && strncmp(domainname, "(none)", 6) != 0) {
Thanks for the hint but I cannot replicate.
I just replaced ran ./configure POSTGRES=NO
and replaced "CC=gcc
" with "CC=clang
" in Makefile.inc and everything compiled fine.
$ clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Nevertheless, clang
rang some new warnings which I used to improve the error handling in the code. Thanks.
What kind of OS are you using?
Currently im compiled on phone (Termux) to test server but planned on FreeBSD or Alpine
~/WendzelNNTPd $ clang --version
clang version 16.0.6
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
Thanks. Unfortunately, I do not have the resources to investigate Termux further but I am pretty sure that there's is just a missing include file. If you look into the getdomainname
manpage and check for a missing #include
that you can add, things should be fixed. Let me know if you find out what it is.
Im included <unistd.h> but i doesnt take effect