Hi Dmitry,

On Sat, Sep 29, 2018 at 11:05:19PM +0300, Dmitry Sivachenko wrote:
> 
> > 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;
(...)

Oh yes I remember seeing these ones reported once, as well as in peers.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))
>                     ^~

Interesting ones! I admit that without context around they clearly look
suspicious, though we tend to know this code works. These ones are easy
to fix.

Thank you!
Willy

Reply via email to