Build error with Clang on 10.6–10.7: `error: call to undeclared library function 'aligned_alloc' with type 'void *(unsigned long, unsigned long)'; ISO C99 and later do not support implicit function declarations`
barracuda156 opened this issue · 0 comments
barracuda156 commented
[ 72%] Building C object CMakeFiles/picotls-minicrypto.dir/deps/cifra/src/poly1305.c.o
/opt/local/bin/clang-mp-16 -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/deps/cifra/src/ext -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/deps/cifra/src -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/deps/micro-ecc -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/deps/picotest -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/build -I/opt/local/libexec/openssl3/include -I/opt/local/include -std=c99 -Wall -O2 -g -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -DPICOTLS_USE_BROTLI=1 -DPTLS_HAVE_FUSION=1 -DPTLS_HAVE_MBEDTLS=1 -arch x86_64 -mmacosx-version-min=10.7 -MD -MT CMakeFiles/picotls-minicrypto.dir/deps/cifra/src/poly1305.c.o -MF CMakeFiles/picotls-minicrypto.dir/deps/cifra/src/poly1305.c.o.d -o CMakeFiles/picotls-minicrypto.dir/deps/cifra/src/poly1305.c.o -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/deps/cifra/src/poly1305.c
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/lib/fusion.c:989:16: error: call to undeclared library function 'aligned_alloc' with type 'void *(unsigned long, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if ((ctx = aligned_alloc(32, ctx_size)) == NULL)
^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_net_picotls/picotls/work/picotls-eb013f761bf1dc3da244322d8569f57b33a95178/lib/fusion.c:989:16: note: include the header <stdlib.h> or explicitly provide a declaration for 'aligned_alloc'
1 error generated.
Something does not work here as supposed with Clang on 10.6–10.7. (With GCC it works, since I have it building on 10.6.)
Notice that stdlib.h
is included in fusion.c
, however Clang is not happy.
@kazuho Could you take a look, please?