aboutsummaryrefslogtreecommitdiff
path: root/m4/disable-compiler-warnings.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/disable-compiler-warnings.m4')
-rw-r--r--m4/disable-compiler-warnings.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/m4/disable-compiler-warnings.m4 b/m4/disable-compiler-warnings.m4
new file mode 100644
index 0000000..2792722
--- /dev/null
+++ b/m4/disable-compiler-warnings.m4
@@ -0,0 +1,29 @@
1AC_DEFUN([DISABLE_COMPILER_WARNINGS], [
2# Clang throws a lot of warnings when it does not understand a flag. Disable
3# this warning for now so other warnings are visible.
4AC_MSG_CHECKING([if compiling with clang])
5AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
6#ifndef __clang__
7 not clang
8#endif
9 ]])],
10 [CLANG=yes],
11 [CLANG=no]
12)
13AC_MSG_RESULT([$CLANG])
14AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
15CFLAGS="$CFLAGS $CLANG_FLAGS"
16LDFLAGS="$LDFLAGS $CLANG_FLAGS"
17
18# Removing the dependency on -Wno-pointer-sign should be a goal. These are
19# largely unsigned char */char* mismatches in asn1 functions.
20save_cflags="$CFLAGS"
21CFLAGS=-Wno-pointer-sign
22AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
23AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
24 [AC_MSG_RESULT([yes])]
25 [AM_CFLAGS=-Wno-pointer-sign],
26 [AC_MSG_RESULT([no])]
27)
28CFLAGS="$save_cflags $AM_CFLAGS"
29])