Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Qsort problem in DEC C
@ 1995-02-03 17:05 David Lloyd
  1995-02-03 18:59 ` David Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Lloyd @ 1995-02-03 17:05 UTC (permalink / 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".

---------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-02-06 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-02-03 17:05 Qsort problem in DEC C David Lloyd
1995-02-03 18:59 ` David Jones
1995-02-03 19:33 ` John Buehler
1995-02-06 23:14 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox