Date: Mon, 16 Sep 1996 17:35:18 +0400 (MSD) From: "Alexander V. Lukyanov" Message-Id: <199609161335.RAA24581@video.yars.free.net> To: kagel AT dg1 DOT bloomberg DOT com, thoni AT softlab DOT se Cc: djgpp AT delorie DOT com Subject: Re: Possible static data zeroisation bug in DJGPP v2? > From: kagel AT quasar DOT bloomberg DOT com > > Static and global variables are not initialized or zero'd unless explicitly > initialized in the code. You have just been lucky because UNIX zeros the > memory pages it assigns to a process so the garbage you have been getting just > happened to be the zeros you wanted. DOS does not zero memory nor does the > DPMI spec require this (IMHO) so DJGPP does not zero uninitialized memory. ANSI requires unitialized static and global variables to be zeroed. So its nothing wrong in not initializing static and global variables. It happened to me to meet a very old unix system in which bss was not zeroed. That fact caused me to spend some time in debugging until I found that out... As to the problem being discussed, it can be caused not by a bug in djgpp, but a bug in gdb. It can just show wrong region of memory. And, of course, it can be caused by a bug in the program itself, say, by overrun array.