]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf tests: Avoid warnings.
authorBruno Haible <bruno@clisp.org>
Sat, 22 Apr 2017 12:51:37 +0000 (14:51 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 22 Apr 2017 12:51:37 +0000 (14:51 +0200)
* tests/test-vasnprintf-posix3.c (test_function, my_asnprintf,
test_vasnprintf, test_asnprintf): Don't define if there's nothing to
test.

ChangeLog
tests/test-vasnprintf-posix3.c

index e956238910207fb6291685498b6fb8f0d683db71..13ae5470bf9a4f89306940ff0f8db82f98397268 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-04-22  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf tests: Avoid warnings.
+       * tests/test-vasnprintf-posix3.c (test_function, my_asnprintf,
+       test_vasnprintf, test_asnprintf): Don't define if there's nothing to
+       test.
+
 2017-04-22  Bruno Haible  <bruno@clisp.org>
 
        sys_file tests: Avoid warning.
index 0e8f93441449ec6dc292f465f210a0e0df3e21ac..c19852601f5d7785e91f180539e71ab460aac197 100644 (file)
 
 #include "macros.h"
 
+/* glibc >= 2.2 supports the 'I' flag, and in glibc >= 2.2.3 the fa_IR
+   locale defines the 'outdigits' to be U+06F0..U+06F9.
+   So we test for glibc >= 2.3.  */
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
+
 static void
 test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
 {
-  /* glibc >= 2.2 supports the 'I' flag, and in glibc >= 2.2.3 the fa_IR
-     locale defines the 'outdigits' to be U+06F0..U+06F9.
-     So we test for glibc >= 2.3.  */
-#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
   /* Test that the 'I' flag is supported.  */
   {
     size_t length;
@@ -45,7 +46,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     ASSERT (length == strlen (result));
     free (result);
   }
-#endif
 }
 
 static char *
@@ -72,6 +72,8 @@ test_asnprintf ()
   test_function (asnprintf);
 }
 
+#endif
+
 int
 main (int argc, char *argv[])
 {