]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/MINOR: lua: fix a harmless build warning
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 17:43:49 +0000 (19:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 17:46:16 +0000 (19:46 +0200)
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.

src/hlua.c

index 320e72900c1b7a5b7e8c601d62eac224e59fba16..026dd2f3324f051cdd79ef358a84669b0a4b1826 100644 (file)
@@ -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];