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 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!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 11 Jul 2006 06:46:56 -0500 Date: Tue, 11 Jul 2006 07:44:23 -0400 From: Jeffrey Creem User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 Subject: Re: Ada vs Fortran for scientific applications 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-dwX89Xw9gs3N0sapOSiW2aaLJ33GjgtJyiTXNuDcSMwoq2CjN2HwlhbBUU6rAgWAJygG+uArdxN6xlh!HK4ldjpbIXlKcCUFeJUKDS26+orH0NM9hpqb1MZ6jP4MKo49xs9k7otSHWupu4ypMpUEpvRKhV54!69U= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5608 comp.lang.fortran:11926 comp.lang.pl1:1976 Date: 2006-07-11T07:44:23-04:00 List-Id: 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. Which LRM section requires that? (Since "Ada compilers" do it, I assume it is a requirement of the LRM?) Since I'd like to have it removed or ammended to require meaningful operation of pragma suppress warnings. I'd guess that at least as many bugs are created by people adding := 0 to suppress the spurious "**might be used before assigned**" warnings that some of the compilers I use spit out as come up from the real unitialized case. I suppose that at least the behaviour when the code hits the case where it is not assigned and it should have been is the same every time (generally) v.s. the real unitialized case but if the case that really triggers the "not assigned meaningfully" case is rare it probably does not make the bug any more difficult to find. Truth be told, it takes an awful lot of work on the part of a compiler to really tell if something *will* be used before it is assigned. I strongly suspect of course that each person that has asserted that language X does something really means that "compiler X, sometimes Y and often Z" does it. And further, that those compilers don't "do it" but that they do something close it it. Compilers that I have used that have the "IS used before it is initialized" are generally providing meaninful information but just as often they spit out "might be used before initialized" and in the vast majority of cases, the "might" is wrong.