From e27c63878bdbed5a130431cac3551c263d152bd0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 22 Apr 2017 14:51:37 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ tests/test-vasnprintf-posix3.c | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e956238910..13ae5470bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-04-22 Bruno Haible + + 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 sys_file tests: Avoid warning. diff --git a/tests/test-vasnprintf-posix3.c b/tests/test-vasnprintf-posix3.c index 0e8f934414..c19852601f 100644 --- a/tests/test-vasnprintf-posix3.c +++ b/tests/test-vasnprintf-posix3.c @@ -26,13 +26,14 @@ #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[]) { -- 2.39.5