summaryrefslogtreecommitdiff
path: root/lib/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strftime.c')
-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)
if (modifier == L_('E'))
goto bad_format;
- 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;
- }
+ {
+ /* 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;
+ }
- DO_NUMBER (width, number_value);
+ DO_NUMBER (width, n);
+ }
#endif
case L_('n'):