From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7b69a8818c20ab9f X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Y21C Bug Date: 2000/01/13 Message-ID: <387DFB1E.CBBF14C7@mail.com>#1/1 X-Deja-AN: 572149128 Content-Transfer-Encoding: 7bit References: <84nqbo$q28$1@nnrp1.deja.com> <84o0g2$u8v$1@nnrp1.deja.com> <84pvrs$7q1@ftp.kvaerner.com> <84sltt$7s3@ftp.kvaerner.com> <84t966$be0$1@nnrp1.deja.com> <84vev2$7p4@ftp.kvaerner.com> <38737352.B282CC2@easystreet.com> <851j2q$78q1@ftp.kvaerner.com> <852dt0$vdl$1@nnrp1.deja.com> <87iu16yxv4.fsf@deneb.cygnus.argh.org> <387B0AC9.AA4E090B@mail.com> <387BC729.9F02FEF1@mail.com> <85irp9$11m$1@front3.grolier.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 947780382 14716 195.141.231.162 (13 Jan 2000 16:19:42 GMT) Organization: sunrise communications ag Mime-Version: 1.0 NNTP-Posting-Date: 13 Jan 2000 16:19:42 GMT Newsgroups: comp.lang.ada Date: 2000-01-13T16:19:42+00:00 List-Id: Thierry Lelegard wrote: > Yes it does. If you had left the variable uninitialized (on an Ada > perspective), then the variable would have been allocated in > a "demand zero" section (no allocation in executable). Since > you provided an explicit initial value, the compiler/linker placed > it into a "copy on reference" section which contains the initial > values. Of course, the compiler could make a special optimization > which consists in inspecting every single byte of this initial > value and if they are all zeroes then place the variable into > a "demand zero" section. But, it appears that this optimization > is not made. You generally cannot guarantee that the variable is allocated in a demand-zero region. For instance, when allocated on the stack, the stack may have previously grown higher than where you allocate and you get the content left there from a previous call (unless the stack is zeroed or unmapped from the address space when it shrinks, but I doubt any system is doing that).