aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-05-16 00:10:39 -0700
committerPaul Eggert2013-05-16 00:10:39 -0700
commitcdd0de4b056b4612e055fa15f65af118dafc9b18 (patch)
treea9d72533fb38b82969308316c958a3263d85d10d
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
-rw-r--r--ChangeLog7
-rw-r--r--lib/sig2str.c12
-rw-r--r--lib/stdio.in.h14
-rw-r--r--m4/manywarnings.m46
-rw-r--r--m4/warnings.m415
5 files changed, 41 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index f8b46164388..ce2014288e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
12013-05-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Merge from gnulib, incorporating:
4 2013-05-15 manywarnings: update for GCC 4.8.0
5 2013-05-15 stdio: use __REDIRECT for fwrite, fwrite_unlocked
6 2013-05-15 sig2str, stdio, warnings: port to clang
7
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 82013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * Makefile.in (install-doc): DOC file is not version specific any more. 10 * Makefile.in (install-doc): DOC file is not version specific any more.
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 8b36e2facf0..6ead2a71d13 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -325,21 +325,25 @@ sig2str (int signum, char *signame)
325 { 325 {
326 int rtmin = SIGRTMIN; 326 int rtmin = SIGRTMIN;
327 int rtmax = SIGRTMAX; 327 int rtmax = SIGRTMAX;
328 int base, delta;
328 329
329 if (! (rtmin <= signum && signum <= rtmax)) 330 if (! (rtmin <= signum && signum <= rtmax))
330 return -1; 331 return -1;
331 332
332 if (signum <= rtmin + (rtmax - rtmin) / 2) 333 if (signum <= rtmin + (rtmax - rtmin) / 2)
333 { 334 {
334 int delta = signum - rtmin; 335 strcpy (signame, "RTMIN");
335 sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); 336 base = rtmin;
336 } 337 }
337 else 338 else
338 { 339 {
339 int delta = rtmax - signum; 340 strcpy (signame, "RTMAX");
340 sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); 341 base = rtmax;
341 } 342 }
342 343
344 delta = signum - base;
345 if (delta != 0)
346 sprintf (signame + 5, "%+d", delta);
343 return 0; 347 return 0;
344 } 348 }
345} 349}
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index d6af99ca77d..06cbad00d3d 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, 579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
580 which sometimes causes an unwanted diagnostic for fwrite calls. 580 which sometimes causes an unwanted diagnostic for fwrite calls.
581 This affects only function declaration attributes under certain 581 This affects only function declaration attributes under certain
582 versions of gcc, and is not needed for C++. */ 582 versions of gcc and clang, and is not needed for C++. */
583# if (0 < __USE_FORTIFY_LEVEL \ 583# if (0 < __USE_FORTIFY_LEVEL \
584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ 585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586 && !defined __cplusplus) 586 && !defined __cplusplus)
587# undef fwrite 587# undef fwrite
588# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) 588# undef fwrite_unlocked
589extern size_t __REDIRECT (rpl_fwrite,
590 (const void *__restrict, size_t, size_t,
591 FILE *__restrict),
592 fwrite);
593extern size_t __REDIRECT (rpl_fwrite_unlocked,
594 (const void *__restrict, size_t, size_t,
595 FILE *__restrict),
596 fwrite_unlocked);
597# define fwrite rpl_fwrite
598# define fwrite_unlocked rpl_fwrite_unlocked
589# endif 599# endif
590# endif 600# endif
591_GL_CXXALIASWARN (fwrite); 601_GL_CXXALIASWARN (fwrite);
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])