SunOS: ratelim.h:55:27: error: initializer element is not constant
Summary
Similar to issue 40410
./tor-0.4.5.11/src/lib/log/ratelim.h
#define RATELIM_INIT(r) { (r), 0, 0, 0 }
error: initializer element is not constant
Steps to reproduce:
- Add tor version 0.4.5.11 in Makefile
- gmake build
What is the current bug behavior?
CC src/feature/dircache/dircache.o
CC src/feature/dircache/dirserv.o
CC src/feature/dirclient/dirclient.o
In file included from /export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/core/or/or.h:50:0,
from /export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/feature/dirclient/dirclient.c:13:
/export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/feature/dirclient/dirclient.c: In function 'dir_client_decompress_response_body':
/export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/lib/log/ratelim.h:55:27: error: initializer element is not constant
#define RATELIM_INIT(r) { (r), 0, 0, 0 }
^
/export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/feature/dirclient/dirclient.c:1963:38: note: in expansion of macro 'RATELIM_INIT'
static ratelim_t warning_limit = RATELIM_INIT(LOG_INTERVAL);
^~~~~~~~~~~~
/export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/lib/log/ratelim.h:55:27: note: (near initialization for 'warning_limit.rate')
#define RATELIM_INIT(r) { (r), 0, 0, 0 }
^
/export/home/svschmel/oi-userland/components/network/tor/tor-0.4.5.11/src/feature/dirclient/dirclient.c:1963:38: note: in expansion of macro 'RATELIM_INIT'
static ratelim_t warning_limit = RATELIM_INIT(LOG_INTERVAL);
^~~~~~~~~~~~
make[2]: *** [Makefile:12413: src/feature/dirclient/dirclient.o] Error 1
make[2]: Leaving directory '/export/home/svschmel/oi-userland/components/network/tor/build/amd64'
make[1]: *** [Makefile:7342: all] Error 2
make[1]: Leaving directory '/export/home/svschmel/oi-userland/components/network/tor/build/amd64'
gmake: *** [/export/home/svschmel/oi-userland/make-rules/configure.mk:183: /export/home/svschmel/oi-userland/components/network/tor/build/amd64/.built] Error 2
What is the expected behavior?
the program should compile without any errors (like version 0.4.5.10)
Environment
Working:
tor -version Oct 28 21:24:16.163 [notice] Tor 0.4.5.10 running on SunOS with Libevent 2.0.22-stable, OpenSSL 1.0.2u, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.5.0 and Unknown N/A as libc.
OpenIndiana Hipster: uname -a SunOS oitor2 5.11 illumos-aa8590303d i86pc i386 i86pc
Installation from Package Server / Repository Server: https://pkg.openindiana.org/
Build with: gmake -v GNU Make 4.3 Built for i386-pc-solaris2.11 Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Not working:
Compiling tor version 0.4.5.11 failed with above error
Building on (personal) build-Server: uname -a SunOS oibuild 5.11 illumos-aa8590303d i86pc i386 i86pc
gmake -v GNU Make 4.3 Built for i386-pc-solaris2.11 Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Relevant logs and/or screenshots
Possible fixes
No solution or workaround found so far.