> On 29 Sep 2018, at 21:41, Willy Tarreau <[email protected]> wrote:
>
> Ah, a small change is that we now build with -Wextra after having addressed
> all warnings reported up to gcc 7.3 and filtered a few useless ones.
Hello,
here are some warnings from clang version 6.0.0:
cc -Iinclude -Iebtree -Wall -Wextra -O2 -pipe -fstack-protector
-fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement
-fwrapv -fno-strict-overflow -Wno-address-of-packed-member -Wno-unused-label
-Wno-sign-compare -Wno-unused-parameter -Wno-ignored-qualifiers
-Wno-missing-field-initializers -Wno-implicit-fallthrough -Wtype-limits
-Wshift-negative-value -Wnull-dereference -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
-I/usr/include -DUSE_PCRE -I/usr/local/include -DUSE_PCRE_JIT
-DCONFIG_HAPROXY_VERSION=\"1.9-dev3\" -DCONFIG_HAPROXY_DATE=\"2018/09/29\" -c
-o src/cfgparse.o src/cfgparse.c
src/cfgparse.c:5131:34: warning: implicit conversion from 'int' to 'char'
changes value from 130 to -126 [-Wconstant-conversion]
curproxy->check_req[5] = 130;
~ ^~~
src/cfgparse.c:5157: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 -Wextra -O2 -pipe -fstack-protector
-fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement
-fwrapv -fno-strict-overflow -Wno-address-of-packed-member -Wno-unused-label
-Wno-sign-compare -Wno-unused-parameter -Wno-ignored-qualifiers
-Wno-missing-field-initializers -Wno-implicit-fallthrough -Wtype-limits
-Wshift-negative-value -Wnull-dereference -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
-I/usr/include -DUSE_PCRE -I/usr/local/include -DUSE_PCRE_JIT
-DCONFIG_HAPROXY_VERSION=\"1.9-dev3\" -DCONFIG_HAPROXY_DATE=\"2018/09/29\" -c
-o src/stick_table.o src/stick_table.c
src/stick_table.c:2018:14: warning: equality comparison with extraneous
parentheses [-Wparentheses-equality]
if ((stkctr == &tmpstkctr))
~~~~~~~^~~~~~~~~~~~~
src/stick_table.c:2018:14: note: remove extraneous parentheses around the
comparison to silence this warning
if ((stkctr == &tmpstkctr))
~ ^ ~
src/stick_table.c:2018:14: note: use '=' to turn this equality comparison into
an assignment
if ((stkctr == &tmpstkctr))
^~
cc -Iinclude -Iebtree -Wall -Wextra -O2 -pipe -fstack-protector
-fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement
-fwrapv -fno-strict-overflow -Wno-address-of-packed-member -Wno-unused-label
-Wno-sign-compare -Wno-unused-parameter -Wno-ignored-qualifiers
-Wno-missing-field-initializers -Wno-implicit-fallthrough -Wtype-limits
-Wshift-negative-value -Wnull-dereference -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
-I/usr/include -DUSE_PCRE -I/usr/local/include -DUSE_PCRE_JIT
-DCONFIG_HAPROXY_VERSION=\"1.9-dev3\" -DCONFIG_HAPROXY_DATE=\"2018/09/29\" -c
-o src/mux_h2.o src/mux_h2.c
src/mux_h2.c:3532:195: warning: implicit conversion from enumeration type 'enum
h1m_state' to different enumeration type 'enum h1_state' [-Wenum-conversion]
...= %d bytes out (%u in, st=%s, ep=%u, es=%s, h2cws=%d h2sws=%d) data=%u",
h2c->st0, h2s->id, size+9, (unsigned int)total, h1_msg_state_str(h1m->state),
h1m->err_pos, h1_ms...
~~~~~~~~~~~~~~~~ ~~~~~^~~~~
cc -Iinclude -Iebtree -Wall -Wextra -O2 -pipe -fstack-protector
-fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement
-fwrapv -fno-strict-overflow -Wno-address-of-packed-member -Wno-unused-label
-Wno-sign-compare -Wno-unused-parameter -Wno-ignored-qualifiers
-Wno-missing-field-initializers -Wno-implicit-fallthrough -Wtype-limits
-Wshift-negative-value -Wnull-dereference -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
-I/usr/include -DUSE_PCRE -I/usr/local/include -DUSE_PCRE_JIT
-DCONFIG_HAPROXY_VERSION=\"1.9-dev3\" -DCONFIG_HAPROXY_DATE=\"2018/09/29\" -c
-o src/peers.o src/peers.c
src/peers.c:253: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:255: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:259: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:261: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:448: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:484:11: warning: implicit conversion from 'int' to 'char' changes
value from 132 to -124 [-Wconstant-conversion]
msg[1] = PEER_MSG_STKT_ACK;
~ ^~~~~~~~~~~~~~~~~