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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!ken-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail From: "robin" Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <2006052509454116807-gsande@worldnetattnet> <1kzktalo9krea$.z8n9wev45xct$.dlg@40tude.net> Subject: Re: Ada vs Fortran for scientific applications X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Message-ID: <5vXsg.3184$tE5.1635@news-server.bigpond.net.au> Date: Wed, 12 Jul 2006 00:37:21 GMT NNTP-Posting-Host: 203.54.237.55 X-Complaints-To: abuse@bigpond.net.au X-Trace: news-server.bigpond.net.au 1152664641 203.54.237.55 (Wed, 12 Jul 2006 10:37:21 EST) NNTP-Posting-Date: Wed, 12 Jul 2006 10:37:21 EST Organization: BigPond Internet Services Xref: g2news2.google.com comp.lang.ada:5632 comp.lang.fortran:11963 comp.lang.pl1:1999 Date: 2006-07-12T00:37:21+00:00 List-Id: John W. Kennedy wrote in message ... >adaworks@sbcglobal.net wrote: >> "robin" wrote in message >> news:z9Dsg.2740$tE5.2374@news-server.bigpond.net.au... >>> Compilers can check for uninitialized variables during compilation. >>> >> True. In fact, Ada compilers issue a warning for any variable >> that is used before a value is assigned to it. If a parameter is >> included in a method (function/procedure/subroutine) and never >> referenced, a warning is issued. Sometimes the pragma >> Normalize_Scalars is useful. Often, the correct design is to >> leave variables uninitialized until they are used so an exception >> can be raised. However, since the compiler will emit a warning >> about variables that have never been assigned a value in an algorithm >> that tries to use it, no harm is really done since the careful programmer >> will not release a program with warnings in it. >> >> So, I am assuming, Robin, that PL/I does something similar: a warning >> for any variable that is used in a program before a value is assigned to it. > >Smart compilers may try to do so, as a by-product of optimization, but >PL/I is too old a design for this sort of thing to be taken for granted; >there are unavoidable holes, because PL/I A) passes by reference, Pass by reference doesn't prevent checking for uninitialized variables. > B) does not have in-out parameter declaration, Well, it does. It's called ASSIGNABLE and NONASSIGNABLE. > and C) uses separate compilation and a dumb linker, It's perhaps 30+ years since I used separate compilation of procedures to be linked subsequently. Memories have become so much larger. All the info is there for the compiler to do a good analysis in a single compilation.