Xref: utzoo comp.unix.i386:6362 comp.unix.wizards:22712 Path: utzoo!attcan!uunet!isc-br!tau-ceti!cims2!proto!joe From: joe@proto.COM (Joe Huffman) Newsgroups: comp.unix.i386,comp.unix.wizards Subject: Re: Initialization of .BSS question. Summary: Sheesh! How could so many people misundertand my question? Keywords: C, C++, Runtime library, Loader, OS Message-ID: <1321@proto.COM> Date: 30 Jun 90 15:42:53 GMT References: <1319@proto.COM> <1990Jun29.014319.11970@virtech.uucp> Organization: Prototronics; Sandpoint, Idaho Lines: 37 In article <1990Jun29.014319.11970@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) writes: > In article <1319@proto.COM> joe@proto.COM (Joe Huffman) writes: > >I am porting the runtime library from a MSDOS compiler to UNIX. Under > > ANY C compiler, when building an executable for a hosted environment, on any > machine under any OS that doesn't initialize all of non-initialized global > variables (.BSS) to all 0's is VERY BROKEN. > > You will not have to add any initialization code to set this stuff to > zero. (And should not have to add it to your DOS compiler. (However, > you DOS compiler may have this stuff in it's setup code that is called > prior to your main() routine, but you should not have to be aware of this > mechanism)). [FLAME ON!] Was I so unclear on this?? Nearly all the respondents seemed to misunderstand me. I am porting (part of) the compiler!! The setup code that calls main is what I was concerned about. This is MY code that calls main() (among other things). I know that .BSS MUST be set to zero (by somebodies code, OS or compiler) or else I wouldn't be worrying about it or have been assigned this task. My concern was whether all UNIX's could be depended on for this. Not whether all 'C' compilers could be counted on for this in your application code. I am aware of that and that is why I was concerned, I did not want to ship a 'VERY BROKEN' C/C++ compiler. [FLAME OFF!] Thank you for your responses. There were a couple of people who understood my question and answered it adequately. Sorry (well, some anyway) for spouting off. Next time (coming up soon) I will be a bit more explicit about what I'm asking about. -- joe@proto.com uunet!proto!joe FAX: 208-263-8772