Include extra compiler flags
authorSergio Durigan Junior <sergiodj@sergiodj.net>
Mon, 14 Apr 2014 05:13:59 +0000 (02:13 -0300)
committerSergio Durigan Junior <sergiodj@sergiodj.net>
Mon, 14 Apr 2014 05:17:00 +0000 (02:17 -0300)
Given the last attempts to clean up the code, this commit adds extra
compiler flags that are useful to keep the codebase sane.  The added
flags, for now, are:

  -Wall -Werror -Wextra -Wunused -Wunused-variable

configure.ac

index a9cce1f..77fc984 100644 (file)
@@ -29,6 +29,7 @@ AM_INIT_AUTOMAKE
 dnl Do we have a usable compiler and 'install'?
 AC_PROG_CC
 AC_PROG_INSTALL
+AC_LANG_WERROR
 
 dnl Checking for GNUTLS and libgcrypt.
 PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0, , AC_MSG_ERROR(Could not find gnutls))
@@ -36,7 +37,9 @@ AM_PATH_LIBGCRYPT(,,AC_MSG_ERROR(Could not find gcrypt))
 
 dnl Setting useful flags.
 LIBS="$LIBGCRYPT_LIBS $GNUTLS_LIBS $LIBS -lz"
-CFLAGS="$LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS $CFLAGS"
+CFLAGS="$LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS \
+       -Wall -Werror -Wextra -Wunused -Wunused-variable \
+       $CFLAGS"
 
 dnl Outputting the necessary files for the build.
 AC_CONFIG_HEADERS([config.h])