Subject: qsort problems
To: None <netbsd-help@NetBSD.ORG>
From: Berndt Josef Wulf <wulf@ping.net.au>
List: netbsd-help
Date: 11/07/1996 17:57:53
G'day all,

I have problems with qsort as long as I can think of when trying to
built packages which utilize this function. On building the package I
get the following warning message:

cc -O -Wall -pedantic -g   -c utmp.c
utmp.c: In function `Set_Time_To_Act':
utmp.c:229: warning: passing arg 4 of `qsort' from incompatible
pointer type

This line looks like this:

qsort( (void *)l_array, (size_t)count, sizeof(TTY_NODE *), comparison);

Argument 4 in this function is defined as followed:

int comparison( TTY_NODE **arg1, TTY_NODE **arg2 )

I have tried almost everthing but can't get it to compile without the
warning message. This is not the only package giving me this trouble,
e.g. msql displays similar problems.

NetBSD and FreeBSD give following definition for qsort in the man-ages:

void
qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *))

I am sure that this has been worked out previously but fail to find
the answer myself...

Can someone explain what needs to be done in view to get a clean
compile? 

cheerio Berndt
-- 
Name	: Berndt Josef Wulf
E-Mail	: wulf@ping.net.au
Sysinfo	: DEC AXPpci33+, NetBSD-1.2