> On 01 Nov 2017, at 02:20, Willy Tarreau <[email protected]> wrote:
>
> Hi all!
>
Hello,
several new warnings from clang, some look meaningful:
cc -Iinclude -Iebtree -Wall -O2 -pipe -fstack-protector -fno-strict-aliasing
-fno-strict-aliasing -Wdeclaration-after-statement -fwrapv
-Wno-address-of-packed-member -Wno-null-dereference -Wno-unused-label
-DFREEBSD_PORTS -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_GETADDRINFO -DUSE_ZLIB
-DENABLE_POLL -DENABLE_KQUEUE -DUSE_CPU_AFFINITY -DUSE_ACCEPT4
-DCONFIG_REGPARM=3 -DUSE_THREAD -DUSE_OPENSSL -DUSE_PCRE -I/usr/local/include
-DUSE_PCRE_JIT -DCONFIG_HAPROXY_VERSION=\"1.8-rc1-901f75c\"
-DCONFIG_HAPROXY_DATE=\"2017/10/31\" -c -o src/standard.o src/standard.c
src/server.c:875:14: warning: address of array 'check->desc' will always
evaluate to 'true' [-Wpointer-bool-conversion]
if (check->desc)
~~ ~~~~~~~^~~~
src/server.c:914:14: warning: address of array 'check->desc' will always
evaluate to 'true' [-Wpointer-bool-conversion]
if (check->desc)
~~ ~~~~~~~^~~~
src/server.c:958:14: warning: address of array 'check->desc' will always
evaluate to 'true' [-Wpointer-bool-conversion]
if (check->desc)
~~ ~~~~~~~^~~~
src/cfgparse.c:5044:34: warning: implicit conversion from 'int' to 'char'
changes value from 130 to -126 [-Wconstant-conversion]
...curproxy->check_req[5] = 130;
~ ^~~
src/cfgparse.c:5070:33: warning: implicit conversion from 'int' to 'char'
changes value from 128 to -128 [-Wconstant-conversion]
...curproxy->check_req[5] = 128;
~ ^~~
cc -Iinclude -Iebtree -Wall -O2 -pipe -fstack-protector -fno-strict-aliasing
-fno-strict-aliasing -Wdeclaration-after-statement -fwrapv
-Wno-address-of-packed-member -Wno-null-dereference -Wno-unused-label
-DFREEBSD_PORTS -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_GETADDRINFO -DUSE_ZLIB
-DENABLE_POLL -DENABLE_KQUEUE -DUSE_CPU_AFFINITY -DUSE_ACCEPT4
-DCONFIG_REGPARM=3 -DUSE_THREAD -DUSE_OPENSSL -DUSE_PCRE -I/usr/local/include
-DUSE_PCRE_JIT -DCONFIG_HAPROXY_VERSION=\"1.8-rc1-901f75c\"
-DCONFIG_HAPROXY_DATE=\"2017/10/31\" -c -o src/sample.o src/sample.c
src/peers.c:255:16: warning: implicit conversion from 'int' to 'char' changes
value from 133 to -123 [-Wconstant-conversion]
*msg_type = PEER_MSG_STKT_UPDATE_TIMED;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/peers.c:257:16: warning: implicit conversion from 'int' to 'char' changes
value from 134 to -122 [-Wconstant-conversion]
*msg_type = PEER_MSG_STKT_INCUPDATE_TIMED;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/peers.c:261:16: warning: implicit conversion from 'int' to 'char' changes
value from 128 to -128 [-Wconstant-conversion]
*msg_type = PEER_MSG_STKT_UPDATE;
~ ^~~~~~~~~~~~~~~~~~~~
src/peers.c:263:16: warning: implicit conversion from 'int' to 'char' changes
value from 129 to -127 [-Wconstant-conversion]
*msg_type = PEER_MSG_STKT_INCUPDATE;
~ ^~~~~~~~~~~~~~~~~~~~~~~
src/peers.c:450:11: warning: implicit conversion from 'int' to 'char' changes
value from 130 to -126 [-Wconstant-conversion]
msg[1] = PEER_MSG_STKT_DEFINE;
~ ^~~~~~~~~~~~~~~~~~~~
src/peers.c:486:11: warning: implicit conversion from 'int' to 'char' changes
value from 132 to -124 [-Wconstant-conversion]
msg[1] = PEER_MSG_STKT_ACK;
~ ^~~~~~~~~~~~~~~~~
cc -Iinclude -Iebtree -Wall -O2 -pipe -fstack-protector -fno-strict-aliasing
-fno-strict-aliasing -Wdeclaration-after-statement -fwrapv
-Wno-address-of-packed-member -Wno-null-dereference -Wno-unused-label
-DFREEBSD_PORTS -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_GETADDRINFO -DUSE_ZLIB
-DENABLE_POLL -DENABLE_KQUEUE -DUSE_CPU_AFFINITY -DUSE_ACCEPT4
-DCONFIG_REGPARM=3 -DUSE_THREAD -DUSE_OPENSSL -DUSE_PCRE -I/usr/local/include
-DUSE_PCRE_JIT -DCONFIG_HAPROXY_VERSION=\"1.8-rc1-901f75c\"
-DCONFIG_HAPROXY_DATE=\"2017/10/31\" -c -o src/freq_ctr.o src/freq_ctr.c
src/mux_h2.c:1734:15: warning: implicit conversion from enumeration type
'enum h2_ss' to different enumeration type 'enum h2_cs'
[-Wenum-conversion]
h2c->st0 = H2_SS_ERROR;
~ ^~~~~~~~~~~
src/mux_h2.c:2321:15: warning: implicit conversion from enumeration type
'enum h2_ss' to different enumeration type 'enum h2_cs'
[-Wenum-conversion]
h2c->st0 = H2_SS_ERROR;
~ ^~~~~~~~~~~
src/mux_h2.c:2435:15: warning: implicit conversion from enumeration type
'enum h2_ss' to different enumeration type 'enum h2_cs'
[-Wenum-conversion]
h2c->st0 = H2_SS_ERROR;
~ ^~~~~~~~~~~
src/mux_h2.c:526:24: warning: unused function 'h2_get_n64' [-Wunused-function]
src/cache.c:176:7: warning: variable 'ret' is used uninitialized whenever 'if'
condition is false [-Wsometimes-uninitialized]
if (len) {
^~~
src/cache.c:202:7: note: uninitialized use occurs here
if ((ret != len) ||
^~~
src/cache.c:176:3: note: remove the 'if' if its condition is always true
if (len) {
^~~~~~~~~
src/cache.c:151:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
src/cache.c:566:9: warning: implicit conversion from enumeration type
'enum act_return' to different enumeration type 'enum act_parse_ret'
[-Wenum-conversion]
return ACT_RET_ERR;
~~~~~~ ^~~~~~~~~~~
src/cache.c:589:11: warning: implicit conversion from enumeration type
'enum act_parse_ret' to different enumeration type 'enum act_return'
[-Wenum-conversion]
return ACT_RET_PRS_OK;
~~~~~~ ^~~~~~~~~~~~~~
src/cache.c:591:11: warning: implicit conversion from enumeration type
'enum act_parse_ret' to different enumeration type 'enum act_return'
[-Wenum-conversion]
return ACT_RET_PRS_ERR;
~~~~~~ ^~~~~~~~~~~~~~~
src/cache.c:594:9: warning: implicit conversion from enumeration type
'enum act_parse_ret' to different enumeration type 'enum act_return'
[-Wenum-conversion]
return ACT_RET_PRS_OK;
~~~~~~ ^~~~~~~~~~~~~~
src/cache.c:622:9: warning: implicit conversion from enumeration type
'enum act_return' to different enumeration type 'enum act_parse_ret'
[-Wenum-conversion]
return ACT_RET_ERR;
~~~~~~ ^~~~~~~~~~~
In file included from ../../ebtree/ebtree.c:21:
../../ebtree/ebtree.h:469:35: warning: taking address of packed member
'branches' of class or structure 'eb_node' may result in an unaligned
pointer value [-Waddress-of-packed-member]
eb_troot_t *new_left = eb_dotag(&new->branches, EB_LEFT);
^~~~~~~~~~~~~
(a lot of similar)