diff options
Diffstat (limited to 'm4/disable-compiler-warnings.m4')
-rw-r--r-- | m4/disable-compiler-warnings.m4 | 29 |
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 @@ | |||
1 | AC_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. | ||
4 | AC_MSG_CHECKING([if compiling with clang]) | ||
5 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | ||
6 | #ifndef __clang__ | ||
7 | not clang | ||
8 | #endif | ||
9 | ]])], | ||
10 | [CLANG=yes], | ||
11 | [CLANG=no] | ||
12 | ) | ||
13 | AC_MSG_RESULT([$CLANG]) | ||
14 | AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments]) | ||
15 | CFLAGS="$CFLAGS $CLANG_FLAGS" | ||
16 | LDFLAGS="$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. | ||
20 | save_cflags="$CFLAGS" | ||
21 | CFLAGS=-Wno-pointer-sign | ||
22 | AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign]) | ||
23 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
24 | [AC_MSG_RESULT([yes])] | ||
25 | [AM_CFLAGS=-Wno-pointer-sign], | ||
26 | [AC_MSG_RESULT([no])] | ||
27 | ) | ||
28 | CFLAGS="$save_cflags $AM_CFLAGS" | ||
29 | ]) | ||