From 05c69924b14d68027a90695a4d8da4ec70c9a886 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 23 Jul 2009 13:27:05 +0200 Subject: testsuite: fix one bug, one warning; extend README (one TODO added) Signed-off-by: Denys Vlasenko --- test/stdlib/qsort.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/stdlib') diff --git a/test/stdlib/qsort.c b/test/stdlib/qsort.c index abc505e2d..74f93315f 100644 --- a/test/stdlib/qsort.c +++ b/test/stdlib/qsort.c @@ -34,7 +34,15 @@ int main(void) printf("[%d] %s\n", i, dirbuf->d_name); } printf("\nCalling qsort()\n"); - qsort(array, numdir, sizeof(struct dirent *), alphasort); + /* Even though some manpages say that alphasort should be + * int alphasort(const void *a, const void *b), + * in reality glibc and uclibc have const struct dirent** + * instead of const void*. + * Therefore we get a warning here unless we use a cast, + * which makes people think that alphasort prototype + * needs to be fixed in uclibc headers. + */ + qsort(array, numdir, sizeof(struct dirent *), (void*) alphasort); for (i = 0; i < numdir; ++i) { dirbuf = array[i]; printf("[%d] %s\n", i, dirbuf->d_name); -- cgit v1.2.3