On Fri, Mar 19, 2021 at 08:15:34PM +0300, Dmitry Sivachenko wrote:
> No, it does not, just the message has changed slightly:
> 
> src/mux_h2.c:4032:49: warning: implicit conversion from 'unsigned int' to 
> 'unsigned short' changes value from 4294934527 to 32767 
> [-Wconstant-conversion]
>         HA_ATOMIC_AND(&h2c->wait_event.tasklet->state, ~TASK_F_USR1);
>         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
> include/haproxy/atomic.h:270:62: note: expanded from macro 'HA_ATOMIC_AND'
> #define HA_ATOMIC_AND(val, flags)    __atomic_and_fetch(val, flags, 
> __ATOMIC_SEQ_CST)

Thanks :-(  So they basically force users to always use a cast for
numeric constants because they don't provide a way to write a short
value and their atomics don't support know what an AND operation is
and that extra bits have no effect on the operation. Pffff... I'm
really really really fed up with the direction that compilers are
taking these days. Having to put casts all over the place to shut
them up about absurdities is really tiring and obfuscating the code
making it more error prone.

I guess we'll have to add yet-another exclusion for a stupid warning.
But I'd claim that it's almost a bug there if their own builtins cannot
be called without spewing warnings.

For your packages you can search for "SPEC_FLAGS" in the Makefile and
add this line, it should do the job and keep your builds clean:

    SPEC_CFLAGS += $(call cc-nowarn,constant-conversion)

Willy

Reply via email to