test-xvasprintf: silence compiler warnings
[gnulib.git] / lib / strftime.c
index 7f06d6f..4ca2ffa 100644 (file)
 #else
 # include <config.h>
 # if FPRINTFTIME
+#  include "ignore-value.h"
 #  include "fprintftime.h"
 # else
 #  include "strftime.h"
 # endif
-# include "ignore-value.h"
 #endif
 
 #include <ctype.h>
@@ -199,6 +199,8 @@ extern char *tzname[];
 #if FPRINTFTIME
 # define cpy(n, s) \
     add ((n),                                                                \
+     do                                                                              \
+       {                                                                     \
         if (to_lowcase)                                                      \
           fwrite_lowcase (p, (s), _n);                                       \
         else if (to_uppcase)                                                 \
@@ -211,8 +213,11 @@ extern char *tzname[];
                is intended to be consistent with the one from ISO C,         \
                which permits failure due to ENOMEM *without* setting the     \
                stream's error indicator.  */                                 \
-            ignore_value (fwrite ((s), _n, 1, p)));                          \
-          }
+            ignore_value (fwrite ((s), _n, 1, p));                           \
+          }                                                                  \
+       }                                                                     \
+     while (0)                                                               \
+    )
 #else
 # define cpy(n, s)                                                           \
     add ((n),                                                                \