From 6e86022909f167a0488033ec155f19436e694852 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 5 Mar 2020 14:32:53 +0100 Subject: [PATCH] build: force libwally-core to compile in C99 mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this gcc 4.8 defaults to an older standard and cannot compile the code: ``` gcc-4.8 -DHAVE_CONFIG_H -I. -I../../libwally-core/src -I../../libwally-core -I../../libwally-core/src/ccan -DWALLY_CORE_BUILD=1 -Wall -Wextra -Wpedantic -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wformat -Wformat-security -Wformat-nonliteral -O0 -ggdb -DBUILD_ELEMENTS=1 -flax-vector-conversions -Wno-unused-function -Wno-long-long -Wno-overlength-strings -Wno-variadic-macros -fvisibility=hidden -g -O2 -MT libwallycore_la-elements.lo -MD -MP -MF .deps/libwallycore_la-elements.Tpo -c ../../libwally-core/src/elements.c -o libwallycore_la-elements.o ../../libwally-core/src/elements.c: In function ‘wally_asset_pak_whitelistproof’: ../../libwally-core/src/elements.c:629:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < num_keys; ++i) { ^ ../../libwally-core/src/elements.c:629:5: note: use option -std=c99 or -std=gnu99 to compile your code ``` Changelog-None --- external/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/Makefile b/external/Makefile index 0c9f1122f..3a5d84f20 100644 --- a/external/Makefile +++ b/external/Makefile @@ -71,7 +71,7 @@ $(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwall $(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) cd external/libwally-core && ./tools/autogen.sh mkdir -p ${TARGET_DIR}/libwally-core-build - cd ${TARGET_DIR}/libwally-core-build && PYTHON_VERSION=3 ${TOP}/libwally-core/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-module-recovery --enable-elements --enable-shared=no --prefix=/ --libdir=/ --enable-debug && $(MAKE) + cd ${TARGET_DIR}/libwally-core-build && PYTHON_VERSION=3 CFLAGS=-std=c99 ${TOP}/libwally-core/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-module-recovery --enable-elements --enable-shared=no --prefix=/ --libdir=/ --enable-debug && $(MAKE) external/jsmn/jsmn.h: submodcheck