summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-03-15 13:47:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-03-15 13:49:58 -0700
commit7950e1dd3fc1ce07cc4d6001de6c11a249b80de8 (patch)
tree75e155ac82d6297a7a42d3116f6028a1b807cd46 /configure.ac
parent218ae59019204311101b1d6f79c86f8815b3a65b (diff)
downloademacs-7950e1dd3fc1ce07cc4d6001de6c11a249b80de8.tar.gz
Port to clang 3.7.0 on x86-64
* configure.ac: Use AS_IF so that gl_WARN_ADD’s prerequisites are not done conditionally. This helps clang, which needs -Wunknown-warning-option later when configured with warnings. * src/editfns.c (invalid_time): Now _Noreturn, since clang isn’t smart enough to figure this out on its own if warnings are enabled. (lisp_time_struct): Redo for clarity, and to pacify clang. * src/xfns.c (x_real_pos_and_offsets) [USE_XCB]: Don’t use uninitialized locals. This avoids undefined behavior and pacifies clang.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 9 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 075f6119ead..d31b8df2b04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -877,18 +877,19 @@ AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
# When compiling with GCC, prefer -isystem to -I when including system
# include files, to avoid generating useless diagnostics for the files.
-if test "$gl_gcc_warnings" != yes; then
+AS_IF([test "$gl_gcc_warnings" != yes],
+ [
isystem='-I'
- if test "$emacs_cv_clang" = yes
- then
+ AS_IF([test "$emacs_cv_clang" = yes],
+ [
# Turn off some warnings if supported.
gl_WARN_ADD([-Wno-switch])
gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
gl_WARN_ADD([-Wno-pointer-sign])
gl_WARN_ADD([-Wno-string-plus-int])
gl_WARN_ADD([-Wno-unknown-attributes])
- fi
-else
+ ])
+ ],[
isystem='-isystem '
# This, $nw, is the list of warnings we disable.
@@ -899,10 +900,9 @@ else
# Old toolkits mishandle 'const'.
nw="$nw -Wwrite-strings"
;;
- *)
- gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
- ;;
esac
+ AS_IF([test -z "$nw"],
+ [gl_WARN_ADD([-Werror], [WERROR_CFLAGS])])
AC_SUBST([WERROR_CFLAGS])
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
@@ -985,7 +985,7 @@ else
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
AC_SUBST([GNULIB_WARN_CFLAGS])
-fi
+ ])
edit_cflags="
s,///*,/,g