summaryrefslogtreecommitdiff
path: root/lib/strftime.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-06-15 13:29:04 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-06-15 13:30:30 -0700
commit21d10e59f89a5bb72829ffb8ebe4463ba4fac124 (patch)
tree5e6d98853562542a09f4bf6cd09d0ec7221ef621 /lib/strftime.c
parent2b9620e6af80a1ce57321bc32d126b602ca493ce (diff)
downloademacs-21d10e59f89a5bb72829ffb8ebe4463ba4fac124.tar.gz
Pacify clang without munging C source
* configure.ac (WARN_CFLAGS): With Clang, use -Wno-tautological-compare regardless of --enable-gcc-warnings. (WERROR_CFLAGS): Simplify assignments, and guarantee it’s always set. * lib/strftime.c: Copy from gnulib, reverting Clang-specific change which I hope is no longer needed. * src/emacs.c (main): Revert rlim_t change, as rlim_t is signed on some older non-POSIX hosts.
Diffstat (limited to 'lib/strftime.c')
-rw-r--r--lib/strftime.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index 18c899d2117..99bee4ef978 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -1123,23 +1123,18 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
if (modifier == L_('E'))
goto bad_format;
- {
- /* Use a new variable here instead of reusing number_value
- because Clang complains about the self-assignment
- generated by DO_NUMBER. */
- ptrdiff_t n = ns;
- if (width == -1)
- width = 9;
- else
- {
- /* Take an explicit width less than 9 as a precision. */
- int j;
- for (j = width; j < 9; j++)
- n /= 10;
- }
+ number_value = ns;
+ if (width == -1)
+ width = 9;
+ else
+ {
+ /* Take an explicit width less than 9 as a precision. */
+ int j;
+ for (j = width; j < 9; j++)
+ number_value /= 10;
+ }
- DO_NUMBER (width, n);
- }
+ DO_NUMBER (width, number_value);
#endif
case L_('n'):