From: lloyd-dr@nlvvax.llnl.egg.nv.doe.gov (David Lloyd)
Subject: Qsort problem in DEC C
Date: Fri, 3 Feb 1995 17:05:43 GMT [thread overview]
Message-ID: <lloyd-dr-0302950907550001@149.252.239.58> (raw)
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 <stdlib.h>
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".
---------------------------------------------------------------------------
next reply other threads:[~1995-02-03 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-02-03 17:05 David Lloyd [this message]
1995-02-03 18:59 ` Qsort problem in DEC C David Jones
1995-02-03 19:33 ` John Buehler
1995-02-06 23:14 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox