summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-12-17 01:12:19 +0100
committerHaru <haru@dotalux.com>2013-12-17 01:12:38 +0100
commit3cd9f8d14eaccaffaa642b5e46f50493c213e7d8 (patch)
treee912516b40e7e351d0dad15310cb2d8e5fc88768 /configure.in
parent15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48 (diff)
downloadhercules-3cd9f8d14eaccaffaa642b5e46f50493c213e7d8.tar.gz
hercules-3cd9f8d14eaccaffaa642b5e46f50493c213e7d8.tar.bz2
hercules-3cd9f8d14eaccaffaa642b5e46f50493c213e7d8.tar.xz
hercules-3cd9f8d14eaccaffaa642b5e46f50493c213e7d8.zip
Increased warnings level in the unix build scripts
- They are now on par with the Xcode project (and similar to the MSVC ones) - this will make it easier to notice issues before committing in future. - If this causes, on your system, warnings that we didn't detect, please let us know! Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in162
1 files changed, 153 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 7db4ceda6..e8e2eba3f 100644
--- a/configure.in
+++ b/configure.in
@@ -433,7 +433,7 @@ AC_PATH_PROG(AR, ar)
AC_LANG([C])
-CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare"
+CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare"
CPPFLAGS="$CPPFLAGS -I../common"
@@ -563,23 +563,50 @@ if test "$enable_lto" != "no" ; then
fi
+AC_MSG_CHECKING([whether $CC supports -Wno-maybe-uninitialized])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-maybe-uninitialized"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [
+ AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([whether $CC can actually use -Wno-maybe-uninitialized])
+ # Note: -Werror must be before -Wno-maybe-uninitialized, otherwise it does not do anything
+ CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [
+ AC_MSG_RESULT([yes])
+ CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized"
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+ )
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
-AC_MSG_CHECKING([whether $CC supports -Wno-pointer-sign])
+AC_MSG_CHECKING([whether $CC supports -Wno-clobbered])
OLD_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wno-pointer-sign"
+CFLAGS="$CFLAGS -Wno-clobbered"
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([int foo;])],
[
AC_MSG_RESULT([yes])
- AC_MSG_CHECKING([whether $CC can actually use -Wno-pointer-sign])
- # This option causes warnings in C++ mode
- # Note: -Werror must be before -Wno-pointer-sign, otherwise it does not do anything
- CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign"
+ AC_MSG_CHECKING([whether $CC can actually use -Wno-clobbered])
+ # Note: -Werror must be before -Wno-clobbered, otherwise it does not do anything
+ CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered"
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([int foo;])],
[
AC_MSG_RESULT([yes])
- CFLAGS="$OLD_CFLAGS -Wno-pointer-sign"
+ CFLAGS="$OLD_CFLAGS -Wno-clobbered"
],
[
AC_MSG_RESULT([no])
@@ -594,6 +621,110 @@ AC_COMPILE_IFELSE(
)
+AC_MSG_CHECKING([whether $CC supports -Wempty-body])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wempty-body"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wnewline-eof])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wnewline-eof"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wshadow])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wshadow"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wint-conversion])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wenum-conversion"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wenum-conversion])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wenum-conversion"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wshorten-64-to-32])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wshorten-64-to-32"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wconstant-conversion])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wconstant-conversion"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+AC_MSG_CHECKING([whether $CC supports -Wbool-conversion])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wbool-conversion"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
AC_MSG_CHECKING([whether $CC supports -Wno-switch])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wno-switch"
@@ -607,6 +738,19 @@ AC_COMPILE_IFELSE(
)
+AC_MSG_CHECKING([whether $CC supports -Wno-missing-field-initializers])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-missing-field-initializers"
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
AC_MSG_CHECKING([whether $CC supports -fPIC])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC"
@@ -870,7 +1014,7 @@ fi
case $enable_debug in
"no")
# default value
- CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses"
+# CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses"
;;
"yes")
CFLAGS="$CFLAGS -g -DDEBUG"