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: martin dot kahlert at mchp dot siemens dot de
- Subject: Re: egcs-19980531, warning patches [part 1/2]
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sat, 06 Jun 1998 01:59:29 -0600
- cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19980605091533.A20801@keksy.mchp.siemens.de>you write:
> Quoting Kaveh R. Ghazi (ghazi@caip.rutgers.edu):
> > Here is another round of warning fixes. This is 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.
>
> I think calloc is an ANSI C library routine, which is as protable as
> can be. On my linux-system man bzero sais under Conforming to:
> '4.3BSD. This function is deprecated -- use memset in new programs'
Note that while calloc may be ANSI and available on systems as
far back as the pdp11 era, it may not be available on embedded targets.
I'd kind of prefer to avoid adding to the list of routines that must
somehow be made available in cross compilation environments due to
uses in libgcc.
jeff