Hi Lukas,

On Saturday, March 06 2021 at 23:48:52 +0100, Lukas Tribus wrote:
> Hello,
> 
> On Sat, 6 Mar 2021 at 21:25, Bertrand Jacquin <bertr...@jacquin.bzh> wrote:
> >
> > gcc returns non zero code if an option is not supported (tested
> > from 6.5 to 10.2).
> >
> >   $ gcc -Wfoobar -E -xc - -o /dev/null < /dev/null > /dev/null 2>&1 ; echo 
> > $?
> >   1
> >
> > clang always return 0 if an option in not recognized unless
> > -Werror is also passed, preventing a correct probing of options
> > supported by the compiler (tested with clang 6.0.1 to 11.1.0)
> 
> -Werror is more than just "-Wunknown-warning-option" on clang.
> -Werror/ERR is specifically optional in the Makefile.
> 
> If we want to change the haproxy build-system to do -Werror from now
> on we need a) discuss it and b) fix it all up. We can't hardcode
> -Werror and at the same time claim that it's an optional parameter.

I am not proposing haproxy build-system to use -Werror here, I'm only
proposing to use -Werror when probing for options supported by the
compiler, as effectively clang return a code if 0 even if an option is
not supported. The fact haproxy does not use -Wno-clobbered today is
with clang build because of an internal bug in clang with how haproxy is
using stdin/stderr indirection.

With the proposal above, Werror is only use to probe options, it is not
reflected in SPEC_CFLAGS.

-- 
Bertrand

Reply via email to