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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,573be8c453ecbff4 X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: 'Read for pointers Date: 2000/07/26 Message-ID: #1/1 X-Deja-AN: 651219684 References: X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@swbell.net X-Trace: nnrp1.sbc.net 964660897 208.191.184.67 (Wed, 26 Jul 2000 20:21:37 CDT) Organization: SBC Internet Services X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 26 Jul 2000 20:21:37 CDT Newsgroups: comp.lang.ada Date: 2000-07-26T00:00:00+00:00 List-Id: wrote in message news:xRLf5.61$M35.39742@news.pacbell.net... > >I'm not sure I see your point, given the context. > The "out" parameter is not set to null so if the procedure has a bug > so that it isn't set, it will retain its previous value. Any > uninitialized variable bug can be hard to find. But a pointer is > especially hard, and in fact most pointers are automatically > initialized to null, which helps a lot. Here the "out" parameter > pointer in fact points to an internally correct data structure, just > the wrong one, or one that might have been deallocated. I think such > a bug might take a while to track down. Having parsed the above a couple of times, let me try to restate what you're saying, just to be sure I understand it. What I believe you're saying -- and if so I agree with it (which is why I question my understanding of it:) -- is this: Given that the value of the actual is copied in for an access type formal parameter of mode out, if the subprogram has a bug such that the formal is not updated then the actual will retain the old value, and this would be a hard bug to find. If that's what you mean I agree, but it is preferable to copying back junk, which can certainly happen with by-copy types other than access types. At least we don't go off into the weeds when dereferencing the pointer. -- Pat Rogers Consulting and Training in: http://www.classwide.com Deadline Schedulability Analysis progers@classwide.com Software Fault Tolerance (281)648-3165 Real-Time/OO Languages Adam ... does not deserve all the credit; much is due to Eve, the first woman, and Satan, the first consultant. Mark Twain