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]

calloc/bzero/memset (Was: egcs-19980531, warning patches)


Den 08-Jun-98 06:20:17 skrev David Edelsohn fĝlgende om "Re: egcs-19980531, warning patches [part 1/2] ":

> 	Many systems implement it as malloc/memset, which is our proposed
> implementation if it does not exist on the system.  I don't know autoconf
> very well, but even I could test for calloc and provide a default
> implementation if it didn't exist.

AC_CHECK_FUNC(calloc) or something like that.

IMHO, it would be best to use calloc(), fall back to malloc()+memset() if
calloc() is not available, and not use malloc()+bzero() because bzero() is
not in the ANSI C stadard while calloc(), malloc() and memset() are.

Regards,

/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻTŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\
| Rask Ingemann Lambertsen       | E-mail: mailto:rask@kampsax.k-net.dk  |
| Registered Phase5 developer    | WWW: http://www.gbar.dtu.dk/~c948374/ |
| A4000, 775 kkeys/s (RC5-64)    | "ThrustMe" on XPilot, ARCnet and IRC  |
|      You have not converted a man because you have silenced him.       |



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