Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!edcastle!aiai!richard From: richard@aiai.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: gcc -Wall fails to catch wrong use of calloc Message-ID: <4763@skye.ed.ac.uk> Date: 23 May 91 13:20:49 GMT References: <33084@usc> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 22 In article <33084@usc> ajayshah@alhena.usc.edu (Ajay Shah) writes: >#include > 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 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@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin