Open eerimoq opened 5 years ago
I am also seeing this error with gcc on Clear Linux
$ gcc --version
gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190529 gcc-9-branch@271737
It can be reproduced exactly as above
Unfortunately, this looks like a bug in dns.c. The project can be found here: https://github.com/wahern/dns
Yes, unfortunately it seems to be pretty widespread throughout the library, and I don't know enough about C macros to fix it :(
@eerimoq @tmlbl I added https://github.com/sustrik/libdill/pull/197 to address this issue. Please take a look.
Compilation also fails at the same point when using: gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
I confirm the same issue on my Linux Manjaro computer, running GCC 9.2.0:
$ gcc --version
gcc (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -a
Linux servername 5.4.13-3-MANJARO #1 SMP PREEMPT Mon Jan 20 18:17:25 UTC 2020 x86_64 GNU/Linux
$ lsb_release -a
LSB Version: n/a
Distributor ID: ManjaroLinux
Description: Manjaro Linux
Release: 18.1.5
Codename: Juhraya
It builds with clang, for people who come here with the same issue. Just do a make CC=clang
and you're good.
with clang --version Ubuntu clang version 11.0.0-++20200929060912+dda0a1867cc-1~exp1~20200929162359.110 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
make CC=clang [ 1%] Building C object CMakeFiles/dill.dir/dns/dns.c.o In file included from /home/immanuel/workspace/libdill/dns/dns.c:94: /home/immanuel/workspace/libdill/dns/dns.c: In function 'dns_p_merge': /home/immanuel/workspace/libdill/dns/dns.h:499:16: error: lvalue required as unary '&' operand 499 | dns_rr_i_init(&dns_quietinit((struct dns_rr_i){ 0, __VA_ARGS__ }), (P)) ...
@ilitzroth It worked for me:
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /bin
Perhaps try these steps:
git clone https://github.com/sustrik/libdill
cd libdill
mkdir build
cd build
CC=clang cmake ..
make
same issue here, why gcc-9/10/11 are all failing?
Failure:
Compiler versions:
I've only tested with these two compilers.