Path: utzoo!attcan!uunet!mcsun!unido!mikros!mwtech!martin From: martin@mwtech.UUCP (Martin Weitzel) Newsgroups: comp.unix.wizards Subject: Re: What machines core dump on deref of NULL? Message-ID: <816@mwtech.UUCP> Date: 26 Jun 90 23:27:33 GMT References: <444@mtndew.UUCP> <31079@cup.portal.com> <2389@aix.aix.kingston.ibm.com> <13226@smoke.BRL.MIL> <2392@aix.aix.kingston.ibm.com> Reply-To: martin@mwtech.UUCP (Martin Weitzel) Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 49 In article <2392@aix.aix.kingston.ibm.com> rlc@aix.aix.kingston.ibm.com (Roger Collins) writes: [some lines deleted] >To give another example of this situation, almost all UNIX systems >initialize .bss to zero. This causes uninitialized global and static >variables to be initialized to zero by default. Many, many programs, >including System V commands, depend on this fact. They assume >uninitialized global and static variables are initialized to zero >even though the C language explicitly says the values are undetermined. K&R1 Page 37: External and static variables are initialized to zero by default ... Page 198: Static and external variables which are not initialized are guaranteed to start off as 0; ... K&R2 Page 40: External and static variables are initialized to zero by default. Page 219: A static object that is not explicitly initialized is initialized as if it (or its members) were assigned the constant 0. I don't have a copy of the ANSI-C-Standard handy, but I'm pretty sure that it gives the same guarantee. Could you please name *one* reference for the C language which supports your claim? >This is wrong, I know. Yes, of course it's wrong - but wouldn't it have been easier to leave the last two sentences out? (Of course, this would have made all the rest of the article pointless, so I guess the last sentence doesn't apply to the claim, but to the fact that many programs make the - perfectly correct - assumption that all uninitialized data is initialized with zero.) >Now, why don't you suggest to your boss that you release a computer >that initializes .bss to 0xffffffff? (Leaving it uninitialized is a >security hole on multiuser systems.) It doesn't break the C language. Really? I'm pretty sure it breaks the C Language! Again: Please name *one* reference for the C language that makes you think it wouldn't. [rest deleted] -- Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83