about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--time/strftime_l.c22
2 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ad24611cfa..6ed7f08529 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-27  Joseph Myers  <joseph@codesourcery.com>
+
+	* time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+	(DO_NUMBER_SPACEPAD): Likewise.
+
 2017-06-27  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
 
 	* sysdeps/arm/armv7/multiarch/Makefile: Add memchr_neon to
diff --git a/time/strftime_l.c b/time/strftime_l.c
index 439b971747..b5ba9ca937 100644
--- a/time/strftime_l.c
+++ b/time/strftime_l.c
@@ -715,12 +715,22 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format,
       format_char = *f;
       switch (format_char)
 	{
-#define DO_NUMBER(d, v) \
-	  digits = d > width ? d : width;				      \
-	  number_value = v; goto do_number
-#define DO_NUMBER_SPACEPAD(d, v) \
-	  digits = d > width ? d : width;				      \
-	  number_value = v; goto do_number_spacepad
+#define DO_NUMBER(d, v)				\
+	  do					\
+	    {					\
+	      digits = d > width ? d : width;	\
+	      number_value = v;			\
+	      goto do_number;			\
+	    }					\
+	  while (0)
+#define DO_NUMBER_SPACEPAD(d, v)		\
+	  do					\
+	    {					\
+	      digits = d > width ? d : width;	\
+	      number_value = v;			\
+	      goto do_number_spacepad;		\
+	    }					\
+	  while (0)
 
 	case L_('%'):
 	  if (modifier != 0)