| delorie.com/archives/browse.cgi | search |
| Xref: | news-dnh.mv.net comp.os.msdos.djgpp:2490 |
| Path: | news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!news.mathworks.com!newshost.marcam.com!usc!elroy.jpl.nasa.gov!ames!waikato!not-for-mail |
| From: | jpg AT cs DOT waikato DOT ac DOT nz (J P Griffiths) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Stupped : V2.0 bug? |
| Date: | 8 Oct 1995 23:07:46 GMT |
| Organization: | The University of Waikato |
| Lines: | 17 |
| Sender: | jpg AT waikato DOT ac DOT nz |
| References: | <DFzxG1 DOT Bwr AT jade DOT mv DOT net> <3074a309 DOT sandmann AT clio DOT rice DOT edu> |
| Reply-To: | jpg AT waikato DOT ac DOT nz |
| Nntp-Posting-Host: | lucy.cs.waikato.ac.nz |
| To: | djgpp AT sun DOT soe DOT clarkson DOT edu |
| Dj-Gateway: | from newsgroup comp.os.msdos.djgpp |
Charles Sandmann (sandmann AT clio DOT rice DOT edu) wrote:
: > Isn't calloc() the function you're supposed to use if you want
: > zeroed memory anyway?
:
: Sure, if you want bug free code :-)
:
: The problems happen when programs access uninitialized memory (variables
: on the stack, or non-initialized malloc()ed memory. The program may work
: under V1.x since that memory is always zeroed.
I had a stunningly bad example of this in some code I wrote - a memset with
the size and count fields swapped that was supposed to zero a block of
memory. Worked for 6 1/2 months under v1, linux, & sparc station, and
then just died under v2 one day, causing me endless amounts of stress!
Just venting,
Jon.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |