gcc -Wall fails to catch wrong use of calloc

Richard Tobin richard at aiai.ed.ac.uk
Thu May 23 23:20:49 AEST 1991


In article <33084 at usc> ajayshah at alhena.usc.edu (Ajay Shah) writes:

>#include <stdlib.h>

>	p = (char *) realloc(200);

... and complains that gcc doesn't produce a warning.

You wouldn't be using a Sun by any chance, would you?  Perhaps a Sun
whose <stdlib.h> contains a line like this:

   extern char *   realloc(/* void *ptr, size_t size */);

Note the commenting out of the arguments.

It's not gcc's fault; just use a real prototype for realloc().

-- Richard
-- 
Richard Tobin,                       JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.lang.c mailing list