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

Compilation error #1

Closed
DataPacRat opened this issue Oct 31, 2019 · 7 comments · Fixed by #4
Closed

Compilation error #1

DataPacRat opened this issue Oct 31, 2019 · 7 comments · Fixed by #4

Comments

@DataPacRat
Copy link

While attempting to compile in Fedora 31:

CC libdill_la-ipaddr.lo
In file included from ipaddr.c:44:
ipaddr.c: In function ‘dill_ipaddr_remotes’:
dns/dns.h:1009:24: error: lvalue required as unary ‘&’ operand
1009 | #define dns_opts(...) (&dns_quietinit((struct dns_options)DNS_OPTS_INIT(VA_ARGS)))
| ^
ipaddr.c:335:47: note: in expansion of macro ‘dns_opts’
335 | dill_dns_hosts, dill_dns_hints, NULL, dns_opts(), &rc);
| ^~~~~~~~
make[2]: *** [Makefile:1785: libdill_la-ipaddr.lo] Error 1
make[2]: Leaving directory '/hd-c/Downloads/tcp-client-server/libdill-2.14'
make[1]: *** [Makefile:1926: all-recursive] Error 1
make[1]: Leaving directory '/hd-c/Downloads/tcp-client-server/libdill-2.14'
make: *** [Makefile:21: libdill.a] Error 2

@milancurcic
Copy link
Member

This belongs here, although knowing your compiler version may help.

@DataPacRat
Copy link
Author

gcc --version reports:
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)

Following your link, it looks like the error is actually the bug listed at wahern/dns#33 , with a fix described at wahern/dns#35 , but that project hasn't been updated in years. Maybe one of the forks at https://github.com/wahern/dns/network/members would work as a replacement?

@milancurcic
Copy link
Member

Good find. I will take a look at the forks. If we find a fixed fork, I'll consider updating and committing a local version of libdill to this repo. The most important thing here is that it builds and works, less important that we get upstream updates if any.

@jvdp1
Copy link

jvdp1 commented Dec 24, 2019

This fork works with gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1):
https://github.com/adel-mamin/libdill/tree/gcc-9-1-0-compilation-fix

@milancurcic
Copy link
Member

Thanks @jvdp1, I prefer this PR which should work with all versions: wahern/dns#35. The one you list fixes GCC 9, but breaks the others (see sustrik/libdill#197 (comment)).

I will wait to see if dns.c gets fixed in libdill master (we still have about a month before the book enters production). If not, I will commit the latest libdill into this repo and apply the patched dns.c, and fix the text to not download the libdill from its website.

@ReinoudBokhorst
Copy link

I ran in the same issue today with GCC 9.3.0 (on Windows WSL). PR wahern/dns#35 hasn't been merged yet but PR sustrik/libdill#197 has (which fixes it for me).

Unfortunately the release packages haven't been updated and also the procedure to compile libdill seems to have changed (automake and libtool). For others running into this, I compiled libdill by cloning the master and following the description here: http://libdill.org/faq.html#how-can-i-access-the-source-code. Then the tcp-client-server worked.

@ka7eh
Copy link

ka7eh commented Feb 23, 2022

I got the same issue. Using clang as suggested here worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants