calloc problem in gnu???

cameron shelley cpshelley at violet.uwaterloo.ca
Thu Oct 11 00:02:36 AEST 1990


In article <8909 at cognos.UUCP> jimp at cognos.UUCP (Jim Patterson) writes:
>In article <1990Oct9.032131.16992 at watdragon.waterloo.edu> cpshelley at violet.waterloo.edu (cameron shelley) writes:
>>Hello!
>>
>>  I've run into a bit of a problem!  The following code is a very
>>simplified version of what I've been trying to do (allocate space
>>for an array in a separate function).  Using gcc, the program 
>>compiles but when run only produces "Illegal Instruction" on stderr.
>
>That's funny. It works for me. I'm using gcc 1.21, Sun 3/60, Sun OS 4.03.
>What are you running on? (It might just be relevant).
>
>Note: this is a REALLY OLD version of GCC.

  Well, I'm running on a Microvax II actually, I'm not sure of the
gcc release though.  Anyway, following a suggestion, I deleted the
#include <stdlib.h> line and declared calloc myself in the file:

   char *calloc(int a, unsigned int b);

which then proceeded to work fine.  Btw, calloc was declared in exactly
this manner in <stdlib.h> (extern of course), so I'm still not quite
sure what's going on here.  But its obviously with the way gcc is set
up on this machine, not with gcc in general.

--
      Cameron Shelley        | "Saw, n.  A trite popular saying, or proverb. 
cpshelley at violet.waterloo.edu|  So called because it makes its way into a
    Davis Centre Rm 2136     |  wooden head."
 Phone (519) 885-1211 x3390  |				Ambrose Bierce



More information about the Comp.lang.c mailing list