[SSSD] [PATCH] Warnings and -Werror from ./configure

Jakub Hrozek jhrozek at redhat.com
Fri Jan 10 09:26:16 UTC 2014


On Thu, Jan 09, 2014 at 09:26:40PM +0100, Stef Walter wrote:
> On 09.01.2014 21:22, Stef Walter wrote:
> > Hey guys,
> > 
> > The other day Stephen suggested that instead of complaining (heh heh) I
> > should submit some patches for moving some of bashrc_sssd into
> > ./configure to make stuff in there more useful.
> > 
> > Here we are.
> 
> Here we are for real.
> 
> Stef
> 

> From 09d4d485a18d2df85516c1eb63558ec9521e5e85 Mon Sep 17 00:00:00 2001
> From: Stef Walter <stefw at redhat.com>
> Date: Thu, 9 Jan 2014 14:12:08 +0100
> Subject: [PATCH 1/2] configure: Enable usual SSSD_WARNINGS automatically

ACK

> From 4d24e85c75e937d7610cc99d469b8cd768e35436 Mon Sep 17 00:00:00 2001
> From: Stef Walter <stefw at redhat.com>
> Date: Thu, 9 Jan 2014 14:26:46 +0100
> Subject: [PATCH 2/2] configure: Add strict compilation mode with
>  --enable-strict
> 
> ---
>  configure.ac | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f89de6e..9156dfa 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -325,7 +325,7 @@ SSS_WARNINGS='
>  for option in $SSS_WARNINGS; do
>      SAVE_CFLAGS="$CFLAGS"
>      CFLAGS="$CFLAGS $option"
> -    AC_MSG_CHECKING([whether compiler understands $option])
> +    AC_MSG_CHECKING([compiler option $option])

Was this hunk intended to be part of patch #1 ?

>      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
>                        [has_option=yes],
>                        [has_option=no])
> @@ -335,6 +335,23 @@ for option in $SSS_WARNINGS; do
>      fi
>  done
>  
> +dnl Strict Compilation -- -Werror etc.
> +
> +AC_ARG_ENABLE(strict, [
> +               AS_HELP_STRING([--enable-strict],
> +               [Strict code compilation [default: no]])
> +             ])
> +
> +AC_MSG_CHECKING([build strict])
> +if test "$enable_strict" = "yes"; then
> +	CFLAGS="$CFLAGS -Werror"
> +elif test "$enable_strict" = "no"; then
> +	CFLAGS="$CFLAGS -Wno-error"
> +	enable_strict="no"
> +fi
> +AC_MSG_RESULT($enable_strict)
> +
> +

I think there should be a default for "enable_strict". Othwerwise the
configure output looks a bit odd when neither --enable-strict nor
--disable-strict is selected:

checking compiler option -Wformat-security... yes
checking build strict... 
checking that generated files are newer than configure... done

I guess using the action-not-found parameter of AC_ARG_ENABLE could be
used?



More information about the sssd-devel mailing list