diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-07-29 11:23:42 +0200 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-07-29 16:47:36 +0200 |
commit | 80923051b3e803bf5bdc118c3bac246a308497d6 (patch) | |
tree | 0ef4ea6ea1f870bce415ad449b4a7b6c54d36e0d /configure.ac | |
parent | 9748b3e9a0732a173337dcd64266e803a3c77c0e (diff) | |
download | gobject-introspection-80923051b3e803bf5bdc118c3bac246a308497d6.tar.gz |
autotools: start using AX_COMPILER_FLAGS, enable -Werror on CI
* This adds a new dependency on autoconf-archive.
* Pass WARN_CFLAGS/WARN_LDFLAGS/WARN_SCANNERFLAGS to everything we control the source of
* Disables all warning flags which make the build error out for now, we'll re-enable them
in followup commits.
* AX_COMPILER_FLAGS is used with the release flag always on so we don't get
-Werror by default.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index b33e56cf..9ae070c0 100644 --- a/configure.ac +++ b/configure.ac @@ -59,29 +59,15 @@ if test "$YACC" = :; then AC_MSG_ERROR([bison not found but required]) fi - -changequote(,)dnl -ensureflag() { - flag="$1"; shift - result="$@" - - case " ${result} " in - *[\ \ ]${flag}[\ \ ]*) ;; - *) result="${flag} ${result}" ;; - esac - - echo ${result} -} -changequote([,])dnl - -if test "$GCC" = "yes"; then - for flag in -Wall -Wchar-subscripts -Wmissing-declarations \ - -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align \ - -Wsign-compare -fno-strict-aliasing; - do - CFLAGS="$(ensureflag $flag $CFLAGS)" - done -fi +# Default compiler warnings +m4_ifndef([AX_COMPILER_FLAGS], [AC_MSG_ERROR(['autoconf-archive' missing])]) +AX_COMPILER_FLAGS(,, [yes]) +# These get triggered a lot, not worth it imo, but feel free to fix them +AX_APPEND_COMPILE_FLAGS([-Wno-discarded-qualifiers -Wno-duplicated-branches -Wno-switch-enum]) +# FIXME: Fix the warnings and remove the flags +AX_APPEND_COMPILE_FLAGS([-Wno-redundant-decls -Wno-switch-default -Wno-shadow -Wno-deprecated-declarations -Wno-cast-function-type -Wno-type-limits]) +AX_APPEND_COMPILE_FLAGS([-Wno-implicit-fallthrough -Wno-suggest-attribute=format -Wno-double-promotion -Wno-sign-compare]) +AX_APPEND_COMPILE_FLAGS([-Wno-incompatible-pointer-types]) # Checks for libraries. AC_CHECK_LIB([dl], [dlopen]) |