This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-19980531, warning patches [part 1/2]


| 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]