aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhilipp Stephani2017-06-13 13:55:44 +0200
committerPhilipp Stephani2017-06-13 13:56:46 +0200
commite408e9aa030a00cb1a61acdc729e8d6786b25fe3 (patch)
tree2173ff44df3fd9d906721137eada524c9e029c0d /lib
parentcc8aa484cdab6b2f33a8c95a5778193c762412b9 (diff)
downloademacs-e408e9aa030a00cb1a61acdc729e8d6786b25fe3.tar.gz
emacs-e408e9aa030a00cb1a61acdc729e8d6786b25fe3.zip
Silence two Clang warnings by introducing additional local variables
* lib/strftime.c (libc_hidden_def): * lib-src/make-docfile.c (put_filename): Introduce local variables to silence Clang warnings.
Diffstat (limited to 'lib')
-rw-r--r--lib/strftime.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index 99bee4ef978..18c899d2117 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -1123,18 +1123,23 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1123 if (modifier == L_('E')) 1123 if (modifier == L_('E'))
1124 goto bad_format; 1124 goto bad_format;
1125 1125
1126 number_value = ns; 1126 {
1127 if (width == -1) 1127 /* Use a new variable here instead of reusing number_value
1128 width = 9; 1128 because Clang complains about the self-assignment
1129 else 1129 generated by DO_NUMBER. */
1130 { 1130 ptrdiff_t n = ns;
1131 /* Take an explicit width less than 9 as a precision. */ 1131 if (width == -1)
1132 int j; 1132 width = 9;
1133 for (j = width; j < 9; j++) 1133 else
1134 number_value /= 10; 1134 {
1135 } 1135 /* Take an explicit width less than 9 as a precision. */
1136 int j;
1137 for (j = width; j < 9; j++)
1138 n /= 10;
1139 }
1136 1140
1137 DO_NUMBER (width, number_value); 1141 DO_NUMBER (width, n);
1142 }
1138#endif 1143#endif
1139 1144
1140 case L_('n'): 1145 case L_('n'):