From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,6e2fef38c9bfb3bf X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,6e2fef38c9bfb3bf X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1995-02-03 11:33:03 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news1.digex.net!tsoft.com!usenet From: buehler@swift.template.com (John Buehler) Newsgroups: comp.sys.dec,comp.os.vms Subject: Re: Qsort problem in DEC C Date: 03 Feb 1995 19:33:03 GMT Organization: Template Software, Inc. Herndon, VA Message-ID: References: NNTP-Posting-Host: 192.9.200.72 In-reply-to: lloyd-dr@nlvvax.llnl.egg.nv.doe.gov's message of Fri, 3 Feb 1995 17:05:43 GMT Xref: nntp.gmd.de comp.sys.dec:21519 comp.os.vms:64116 David Lloyd writes: >int compare (int *a, int *b) [snip] > qsort(intarray, 10, sizeof(int), compare); >Line 305: qsort(intarray, 10, sizeof(int), compare); >%CC-W-PTRMISMATCH, In this statement, the referenced type of the pointer value > "compare" is "function (...) returning int", which is not compatible with > "function (...) returning int". The warning is complaining about the parameter types on your function. A qsort callback should take 'const void *' according to the function prototype in stdlib.h Apparently, you have to declare your function with those types on your parameters and then cast them to 'int *'. If anybody else has a better workaround, I'd be interested in hearing it. JB -- John Buehler Template Software 13100 Worldgate Drive, Suite 340 Herndon, VA 22070-4382 email: buehler@template.com voice: 703-318-1000 fax:703-318-7378 "Inertia is nature's default"