sustrik / libdill

Structured concurrency in C
MIT License
1.69k stars 155 forks source link

Build fails on dns.h / dns.c with gcc-13.2.0 #229

Open jnorrid opened 8 months ago

jnorrid commented 8 months ago

I am running Ubuntu 23.10 and gcc-13.2.0.

When I attempt to build libdill from source using:

$ ./autogen.sh $ ./configure $ make

the build halts with the following error(s):

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[1]: [Makefile:1855: libdill_la-ipaddr.lo] Error 1 make[1]: Leaving directory '/home/jnorrid/data/wip/libdill/libdill-2.14' make: [Makefile:1996: all-recursive] Error 1

Is this due to a change in compiler behavior with the newer gcc?

I read about dns_quietinit in the "COMPILER ANNOTATIONS" section of dns/dns.h but have not been able to identify a solution.

barracuda156 commented 7 months ago

Fails on macOS likewise:

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);
      |                                               ^~~~~~~~
  CC       libdill_la-prefix.lo
make[1]: *** [libdill_la-ipaddr.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libdill/libdill/work/libdill-2.14'
make: *** [all-recursive] Error 1
mjolk commented 4 months ago

weird this was fixed a long time ago with https://github.com/sustrik/libdill/pull/197 i'm on gcc (GCC) 14.1.1 and it compiles fine.

barracuda156 commented 4 months ago

@mjolk Well, I can try it with gcc-14 and share a log, if it fails.

mjolk commented 4 months ago

@barracuda156 i can clearly see in the posted stuff that you do not have the changes of the PR I referenced, check the source you're compiling from.

edit: ok i see what's going on, you're compiling from latest tag, you should compile from master

barracuda156 commented 4 months ago

@mjolk Well, because the last release does not include it. Time to make a new release, finally, which will be buildable.