From: Willy Tarreau Date: Mon, 20 Nov 2023 10:43:52 +0000 (+0100) Subject: BUILD: cache: fix build error on older compilers X-Git-Tag: v2.9-dev11~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e913909e767ee0491ab65325072accd0ff04032;p=thirdparty%2Fhaproxy.git BUILD: cache: fix build error on older compilers pre-c99 compilers will fail to build the cache since commit 48f81ec09 ("MAJOR: cache: Delay cache entry delete in reserve_hot function") due to an int declaration in the for loop. No backport is needed. --- diff --git a/src/cache.c b/src/cache.c index a19718cc72..272aed0cad 100644 --- a/src/cache.c +++ b/src/cache.c @@ -2307,6 +2307,7 @@ int post_check_cache() struct shared_context *shctx; int ret_shctx; int err_code = ERR_NONE; + int i; list_for_each_entry_safe(cache_config, back, &caches_config, list) { @@ -2333,7 +2334,7 @@ int post_check_cache() LIST_APPEND(&caches, &cache->list); LIST_DELETE(&cache_config->list); free(cache_config); - for (int i = 0; i < CACHE_TREE_NUM; ++i) { + for (i = 0; i < CACHE_TREE_NUM; ++i) { cache->trees[i].entries = EB_ROOT; HA_RWLOCK_INIT(&cache->trees[i].lock);