This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-19980531, warning patches [part 1/2]
- To: egcs at cygnus dot com, ghazi at caip dot rutgers dot edu
- Subject: Re: egcs-19980531, warning patches [part 1/2]
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Thu, 4 Jun 1998 16:15:01 -0400
| Please pay special attention to the libgcc2.c change where I replaced
| malloc/bzero with calloc. The replacement eliminates a warning about
| bzero not being prototyped (and is more optimal on linux??)
|
| I'd like first to know if relying on calloc is considered portable.
| The xcalloc implementations I found in gcc's source don't call calloc,
| instead they manually call malloc/bzero.
Calloc came into the AT&T standard library about the same time as printf (ie,
before UNIX V7 was released). Really early libraries had cfree that you were
supposed to call pointers that were allocated via calloc, but that requirement
was dropped many ages ago. It is part of the ISO C standard. So I would say
go for it.
--
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com, 617-354-5416 (office), 617-354-7161 (fax)