akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.05k stars 809 forks source link

Cannot compile under alpine 3.12 with "-static" #563

Closed RokkuCode closed 3 years ago

RokkuCode commented 3 years ago
./configure CFLAGS="-static"

Error

make  all-recursive
make[1]: Entering directory '/yara/jansson-1.0'
Making all in doc
make[2]: Entering directory '/yara/jansson-1.0/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/yara/jansson-1.0/doc'
Making all in src
make[2]: Entering directory '/yara/jansson-1.0/src'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -Wall -Wextra -Werror -std=c99 -static -MT dump.lo -MD -MP -MF .deps/dump.Tpo -c -o dump.lo dump.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -Wextra -Werror -std=c99 -MT dump.lo -MD -MP -MF .deps/dump.Tpo -c dump.c -o dump.o
mv -f .deps/dump.Tpo .deps/dump.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -Wall -Wextra -Werror -std=c99 -static -MT hashtable.lo -MD -MP -MF .deps/hashtable.Tpo -c -o hashtable.lo hashtable.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -Wextra -Werror -std=c99 -MT hashtable.lo -MD -MP -MF .deps/hashtable.Tpo -c hashtable.c -o hashtable.o
hashtable.c:66:27: error: 'num_primes' defined but not used [-Werror=unused-const-variable=]
   66 | static const unsigned int num_primes = sizeof(primes) / sizeof(unsigned int);
      |                           ^~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:299: hashtable.lo] Error 1
make[2]: Leaving directory '/yara/jansson-1.0/src'
make[1]: *** [Makefile:256: all-recursive] Error 1
make[1]: Leaving directory '/yara/jansson-1.0'
make: *** [Makefile:186: all] Error 2
RokkuCode commented 3 years ago

I tested it with the master branch, that worked. But the release version is bugged.

ploxiln commented 3 years ago

This line was removed in version 2.2.1 in 2011, there have been many releases since then. I guess you are sticking with the 1.x branch from 2010?