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

Cannot compile: "lvalue required as unary ‘&’ operand" #221

Closed
bortzmeyer opened this issue Jun 25, 2019 · 4 comments
Closed

Cannot compile: "lvalue required as unary ‘&’ operand" #221

bortzmeyer opened this issue Jun 25, 2019 · 4 comments

Comments

@bortzmeyer
Copy link

I'm trying to install cqueues (I need it for lua-http):

% sudo luarocks install cqueues
Installing https://luarocks.org/cqueues-20171014.53-0.src.rock

enabling Lua 5.1
enabling Lua 5.3
cp /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/config.h.guess /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/config.h
cp /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/config.h /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/config.h
mkdir -p /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/5.3
gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra  -Wno-missing-field-initializers  -Wno-override-init -Wno-unused -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/usr/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/usr/include" -I"/usr/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20171014L  -c -o /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/5.3/cqueues.o /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/cqueues.c
[Lots of warnings deleted]
In file included from /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/dns.c:43:
/tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/dns.c: In function ‘res_new’:
/tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/lib/dns.h:1059:24: error: lvalue required as unary ‘&’ operand
 1059 | #define dns_opts(...) (&dns_quietinit((struct dns_options)DNS_OPTS_INIT(__VA_ARGS__)))
      |                        ^
/tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/dns.c:2133:59: note: in expansion of macro ‘dns_opts’
 2133 |  if (!(R->res = dns_res_open(resconf, hosts, hints, NULL, dns_opts(.closefd = { R, &res_closefd }), &error)))
      |                                                           ^~~~~~~~
make: *** [/tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/GNUmakefile:86: /tmp/luarocks_cqueues-20171014.53-0-SAtOXt/cqueues-rel-20171014/src/5.3/dns.o] Error 1

Error: Build error: Failed building.

Arch Linux x86_64 with gcc:

% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto
Thread model: posix
gcc version 9.1.0 (GCC) 
@vcunat
Copy link
Contributor

vcunat commented Jun 25, 2019

Clearly a duplicate of #212

@GildedHonour
Copy link

what's the solution?

@vcunat
Copy link
Contributor

vcunat commented Jul 9, 2019

@GildedHonour: please do not split the discussion among multiple threads. It's #212. That work-around patch was tested on Fedora, but I believe it will work fine anywhere if using gcc9 (it will have problems with clang probably, but there you can still do without any patch AFAIK).

@GildedHonour

This comment has been minimized.

Repository owner locked as resolved and limited conversation to collaborators Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants