From 2231b638877aff9fc215377f9d6952630fb31d3c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 29 Mar 2019 18:26:52 +0100 Subject: [PATCH] BUILD: cache: avoid a build warning with some compilers/linkers The struct http_cache_applet was fully declared at the beginning instead of just doing a forward declaration using an extern modifier. Some linkers report warnings about a redefined symbol since these really are two complete declarations. The proper way to do this is to use extern on the first one and to have a full declaration later. However it's not permitted to have both static and extern so the change done in commit 0f2229943 ("CLEANUP: cache: don't export http_cache_applet anymore") has to be partially undone. This should be backported to 1.9 for sanity but has no effet on most platforms. However on 1.9 the extern keyword must also be added to include/types/cache.h. --- src/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cache.c b/src/cache.c index 879e068c5..44355cd86 100644 --- a/src/cache.c +++ b/src/cache.c @@ -48,7 +48,7 @@ const char *cache_store_flt_id = "cache store filter"; -static struct applet http_cache_applet; +extern struct applet http_cache_applet; struct flt_ops cache_ops; @@ -1839,7 +1839,7 @@ static struct action_kw_list http_req_actions = { INITCALL1(STG_REGISTER, http_req_keywords_register, &http_req_actions); -static struct applet http_cache_applet = { +struct applet http_cache_applet = { .obj_type = OBJ_TYPE_APPLET, .name = "", /* used for logging */ .fct = http_cache_io_handler,