Re: [PHP4BETA] TSRM problems... UMBRs everywhere:-((
| From: | Paul DuBois | Date: | Thu, 23 Dec 1999 16:21:25 +0000 |
| Subject: | Re: [PHP4BETA] TSRM problems... UMBRs everywhere:-(( | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8453@lists.php.net to get a copy of this message | ||
At 5:54 PM +0200 1999-12-23, <zeev@zend.com> wrote:
On Thu, 23 Dec 1999, Thies C. Arntzen wrote:Doesn't bss go back to (at least) the very earliest UNIX that ran on a PDP-8 or whatever it was? I don't have my K&R at hand, but I believe it's guaranteed in C that globals are initialized to zero. -- Paul DuBois, paul@snake.netOn Thu, 23 Dec 1999 zeev@zend.com wrote:On Thu, 23 Dec 1999, Thies C. Arntzen wrote:remember - global variables are usually zeroed when the program loads: #include <stdio.h> int not_reported; main() {I think it's a purify bug then.int reported; printf("%d\n",not_reported); printf("%d\n",reported);} purify will not report not_reported 'cause the crt *will* initialize it to zero!sorry, you're wrong: bss section ----------- This section contains zeroed bytes when your program begins running. It is used to hold unitialized variables or common storage. The length of each partial program's bss section is important, but because it starts out containing zeroed bytes there is no need to store explicit zero bytes in the object file. The bss section was invented to eliminate those explicit zeros from object files.This is specific to Solaris, I think. AFAIK, the C standard doesn't say that globals are zerod if not explicitly initialized (the C++ standard says that about static member variables, but that's about it).