From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,6e2fef38c9bfb3bf,start X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,6e2fef38c9bfb3bf,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1995-02-03 09:05:43 PST Newsgroups: comp.sys.dec,comp.os.vms Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!sgigate.sgi.com!enews.sgi.com!lll-winken.llnl.gov!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!gatech!udel!news.mathworks.com!uunet!news!NewsWatcher!user From: lloyd-dr@nlvvax.llnl.egg.nv.doe.gov (David Lloyd) Subject: Qsort problem in DEC C Message-ID: Sender: news@news.egg.nv.doe.gov (USENET News System) Nntp-Posting-Host: 149.252.239.58 Organization: EG&G/EM, Las Vegas, NV Date: Fri, 3 Feb 1995 17:05:43 GMT Xref: nntp.gmd.de comp.sys.dec:21492 comp.os.vms:63975 All right, I've apparently gone brain-dead, but I cannot for the life of me get the following C example to compile with DEC C 4.0 under OpenVMS/VAX V6.1. I get the warning message (between the dashed lines) that says (to me anyway) "a" is not compatible with "a". Can anyone tell me where my programming and/or linguistic skills left the room (with my sanity not far behind)? /* Program that does no useful work */ #include int compare (int *a, int *b) { if (a < b) return(-1); if (a == b) return(0); if (a > b) return(1); } void main(int argc, char** argv) { int intarray[10] = {4,3,6,2,1,7,9,8,3,1}; qsort(intarray, 10, sizeof(int), compare); return; } --------------------------------------------------------------------------- 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". ---------------------------------------------------------------------------