> Another approach is to add -Werror last (this is what Eric Blake
> suggested on the autoconf mailing list a long time ago), e.g.:
>
> AC_DEFUN([OVS_ENABLE_WERROR],
> [AC_ARG_ENABLE(
> [Werror],
> [AC_HELP_STRING([--enable-Werror], [Add -Werror to CFLAGS])],
> [], [enable_Werror=no])
> AC_CONFIG_COMMANDS_PRE(
> [if test "X$enable_Werror" = Xyes; then
> CFLAGS="$CFLAGS -Werror"
> fi])])
But does that really work? Don't you risk affecting ./configure checks
that often are written in a way that triggers warnings, and with the
-Werror flag, leads to compilation errors. If the only reason for the
compilation to fail was the -Werror flag, then that ./configure check
has the wrong result. I guess it may depend on where in the ./configure
run the statement above is placed, but that seems fragile to me.