coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
518 stars 260 forks source link

compile error on OSX with compile option --with-patricia #202

Open teslamint opened 8 years ago

teslamint commented 8 years ago
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT garden.lo -MD -MP -MF .deps/garden.Tpo -c garden.c  -fno-common -DPIC -o .libs/garden.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT dns.lo -MD -MP -MF .deps/dns.Tpo -c dns.c  -fno-common -DPIC -o .libs/dns.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT session.lo -MD -MP -MF .deps/session.Tpo -c session.c  -fno-common -DPIC -o .libs/session.o
garden.c:95:42: error: function definition is not allowed here
  void cb (prefix_t *prefix, void *data) {
                                         ^
garden.c:111:35: error: use of undeclared identifier 'cb'
    patricia_process(dhcp->ptree, cb);
                                  ^
garden.c:127:39: error: use of undeclared identifier 'cb'
    patricia_process(dhcp->ptree_dyn, cb);
                                      ^
3 errors generated.
make[2]: *** [garden.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT session.lo -MD -MP -MF .deps/session.Tpo -c session.c -o session.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT dns.lo -MD -MP -MF .deps/dns.Tpo -c dns.c -o dns.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT pkt.lo -MD -MP -MF .deps/pkt.Tpo -c pkt.c  -fno-common -DPIC -o .libs/pkt.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/local/Cellar/coova-chilli/HEAD/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/local/Cellar/coova-chilli/HEAD/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/local/Cellar/coova-chilli/HEAD/var/run\" -DSBINDIR=\"/usr/local/Cellar/coova-chilli/HEAD/sbin\" -I../json -DDEFLIBDIR=\"/usr/local/Cellar/coova-chilli/HEAD/lib/coova-chilli\" -g -O2 -MT pkt.lo -MD -MP -MF .deps/pkt.Tpo -c pkt.c -o pkt.o >/dev/null 2>&1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

full logs: https://gist.github.com/teslamint/68efb18a731773d0bccb

sevan commented 8 years ago

clang doesn't support in the implementation of nested functions, if you really need this to work right now on OS X until a fix is commited, compile coova with GCC instead.

teslamint commented 8 years ago

It's not urgent, so I'll take a look while on waiting a fix.