From 5eb79ff3b951fb756e17d8a06b5608b179ddbd60 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 3 Dec 2023 09:44:45 +0100 Subject: [PATCH] package/libmemcached: fix build with gcc 4.8 Fix the following build failure with gcc 4.8 raised since bump to version 1.1.4 in commit 7205df8a4f3c729b11a5f0c34885e6cf592f24b9: /home/buildroot/autobuild/run/instance-0/output-1/build/libmemcached-1.1.4/src/libmemcachedprotocol/ascii_handler.c: In function 'ascii_get_response_handler': /home/buildroot/autobuild/run/instance-0/output-1/build/libmemcached-1.1.4/src/libmemcachedprotocol/ascii_handler.c:249:3: error: 'for' loop initial declarations are only allowed in C99 mode for (int x = 0; x < keylen; ++x) { ^ Fixes: - http://autobuild.buildroot.org/results/202aeec4dda822ac341d8882f84f968a303697c3 Signed-off-by: Fabrice Fontaine Signed-off-by: Peter Korsgaard --- package/libmemcached/libmemcached.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/libmemcached/libmemcached.mk b/package/libmemcached/libmemcached.mk index f86cdd3bbf8a..63df8f5c20a0 100644 --- a/package/libmemcached/libmemcached.mk +++ b/package/libmemcached/libmemcached.mk @@ -16,7 +16,9 @@ LIBMEMCACHED_CPE_ID_VENDOR = awesome # Force Release otherwise libraries will be suffixed by -dbg which will raise # unexpected build failures with packages that use libmemcached (e.g. c-icap) -LIBMEMCACHED_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release +LIBMEMCACHED_CONF_OPTS += \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -std=c99" ifeq ($(BR2_PACKAGE_LIBEVENT),y) LIBMEMCACHED_DEPENDENCIES += libevent