aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2013-05-16 00:10:39 -0700
committerPaul Eggert2013-05-16 00:10:39 -0700
commitcdd0de4b056b4612e055fa15f65af118dafc9b18 (patch)
treea9d72533fb38b82969308316c958a3263d85d10d /m4
parent9df4ec5e9044e92e792ba9e8cb714603e32c5cc5 (diff)
downloademacs-cdd0de4b056b4612e055fa15f65af118dafc9b18.tar.gz
emacs-cdd0de4b056b4612e055fa15f65af118dafc9b18.zip
Merge from gnulib.
2013-05-15 manywarnings: update for GCC 4.8.0 2013-05-15 stdio: use __REDIRECT for fwrite, fwrite_unlocked 2013-05-15 sig2str, stdio, warnings: port to clang
Diffstat (limited to 'm4')
-rw-r--r--m4/manywarnings.m46
-rw-r--r--m4/warnings.m415
2 files changed, 14 insertions, 7 deletions
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 45a30afda70..be6d4c91c50 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -98,6 +98,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
98 -W \ 98 -W \
99 -Wabi \ 99 -Wabi \
100 -Waddress \ 100 -Waddress \
101 -Waggressive-loop-optimizations \
101 -Wall \ 102 -Wall \
102 -Warray-bounds \ 103 -Warray-bounds \
103 -Wattributes \ 104 -Wattributes \
@@ -125,7 +126,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
125 -Wformat-security \ 126 -Wformat-security \
126 -Wformat-y2k \ 127 -Wformat-y2k \
127 -Wformat-zero-length \ 128 -Wformat-zero-length \
128 -Wformat=2 \
129 -Wfree-nonheap-object \ 129 -Wfree-nonheap-object \
130 -Wignored-qualifiers \ 130 -Wignored-qualifiers \
131 -Wimplicit \ 131 -Wimplicit \
@@ -143,9 +143,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
143 -Wmissing-braces \ 143 -Wmissing-braces \
144 -Wmissing-declarations \ 144 -Wmissing-declarations \
145 -Wmissing-field-initializers \ 145 -Wmissing-field-initializers \
146 -Wmissing-format-attribute \
147 -Wmissing-include-dirs \ 146 -Wmissing-include-dirs \
148 -Wmissing-noreturn \
149 -Wmissing-parameter-type \ 147 -Wmissing-parameter-type \
150 -Wmissing-prototypes \ 148 -Wmissing-prototypes \
151 -Wmudflap \ 149 -Wmudflap \
@@ -166,6 +164,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
166 -Wpointer-sign \ 164 -Wpointer-sign \
167 -Wpointer-to-int-cast \ 165 -Wpointer-to-int-cast \
168 -Wpragmas \ 166 -Wpragmas \
167 -Wreturn-local-addr \
169 -Wreturn-type \ 168 -Wreturn-type \
170 -Wsequence-point \ 169 -Wsequence-point \
171 -Wshadow \ 170 -Wshadow \
@@ -187,7 +186,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
187 -Wtype-limits \ 186 -Wtype-limits \
188 -Wuninitialized \ 187 -Wuninitialized \
189 -Wunknown-pragmas \ 188 -Wunknown-pragmas \
190 -Wunreachable-code \
191 -Wunsafe-loop-optimizations \ 189 -Wunsafe-loop-optimizations \
192 -Wunused \ 190 -Wunused \
193 -Wunused-but-set-parameter \ 191 -Wunused-but-set-parameter \
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 4b2ac385019..184873283bb 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
1# warnings.m4 serial 7 1# warnings.m4 serial 8
2dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_COMPILER_OPTION_IF],
27AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl 27AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
28AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ 28AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
29 gl_save_compiler_FLAGS="$gl_Flags" 29 gl_save_compiler_FLAGS="$gl_Flags"
30 gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"]) 30 gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors $1"])
31 AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], 31 AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
32 [AS_VAR_SET(gl_Warn, [yes])], 32 [AS_VAR_SET(gl_Warn, [yes])],
33 [AS_VAR_SET(gl_Warn, [no])]) 33 [AS_VAR_SET(gl_Warn, [no])])
@@ -38,6 +38,14 @@ AS_VAR_POPDEF([gl_Flags])dnl
38AS_VAR_POPDEF([gl_Warn])dnl 38AS_VAR_POPDEF([gl_Warn])dnl
39]) 39])
40 40
41# gl_UNKNOWN_WARNINGS_ARE_ERRORS
42# ------------------------------
43# Clang doesn't complain about unknown warning options unless one also
44# specifies -Wunknown-warning-option -Werror. Detect this.
45AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
46[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
47 [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
48 [gl_unknown_warnings_are_errors=])])
41 49
42# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS], 50# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
43# [PROGRAM = AC_LANG_PROGRAM()]) 51# [PROGRAM = AC_LANG_PROGRAM()])
@@ -47,7 +55,8 @@ AS_VAR_POPDEF([gl_Warn])dnl
47# 55#
48# If VARIABLE is a variable name, AC_SUBST it. 56# If VARIABLE is a variable name, AC_SUBST it.
49AC_DEFUN([gl_WARN_ADD], 57AC_DEFUN([gl_WARN_ADD],
50[gl_COMPILER_OPTION_IF([$1], 58[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
59gl_COMPILER_OPTION_IF([$1],
51 [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], 60 [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
52 [], 61 [],
53 [$3]) 62 [$3])