From: Willy Tarreau Date: Wed, 17 Jun 2015 17:43:49 +0000 (+0200) Subject: BUILD/MINOR: lua: fix a harmless build warning X-Git-Tag: v1.6-dev3~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22b0a68120e6c7bebe15c4b60dca0acebf32df50;p=thirdparty%2Fhaproxy.git BUILD/MINOR: lua: fix a harmless build warning Dmitry Sivachenko reported the following build warning using Clang, though it's harmless : src/hlua.c:1911:13: warning: variable '_socket_info_expanded_form' is not needed and will not be emitted [-Wunneeded-internal-declaration] static char _socket_info_expanded_form[] = SOCKET_INFO_EXPANDED_FORM; ^ Indeed, the variable is not used except to compute a sizeof which is taken from the string it is initialized from. It probably is a leftover after various code refactorings. Let's get rid of it now since it's not used anymore. No backport is needed. --- diff --git a/src/hlua.c b/src/hlua.c index 320e72900c..026dd2f332 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1907,9 +1907,7 @@ static int hlua_socket_send(struct lua_State *L) return MAY_LJMP(hlua_socket_write_yield(L, 0, 0)); } -#define SOCKET_INFO_EXPANDED_FORM "[0000:0000:0000:0000:0000:0000:0000:0000]:12345" -static char _socket_info_expanded_form[] = SOCKET_INFO_EXPANDED_FORM; -#define SOCKET_INFO_MAX_LEN (sizeof(_socket_info_expanded_form)) +#define SOCKET_INFO_MAX_LEN sizeof("[0000:0000:0000:0000:0000:0000:0000:0000]:12345") __LJMP static inline int hlua_socket_info(struct lua_State *L, struct sockaddr_storage *addr) { static char buffer[SOCKET_INFO_MAX_LEN];