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!news1.google.com!atl-c05.usenetserver.com!news.usenetserver.com!peer01.west.cox.net!cox.net!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr25.news.prodigy.net.POSTED!4988f22a!not-for-mail From: 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-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response Message-ID: NNTP-Posting-Host: 70.134.98.164 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr25.news.prodigy.net 1152629466 ST000 70.134.98.164 (Tue, 11 Jul 2006 10:51:06 EDT) NNTP-Posting-Date: Tue, 11 Jul 2006 10:51:06 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: [[PGW^WETZSMB_DX]BCBNWX@RJ_XPDLMN@GZ_GYO^BTBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN Date: Tue, 11 Jul 2006 14:51:06 GMT Xref: g2news2.google.com comp.lang.ada:5613 comp.lang.fortran:11936 comp.lang.pl1:1980 Date: 2006-07-11T14:51:06+00:00 List-Id: "Jeffrey Creem" wrote in message news:ghfco3-4am.ln1@newserver.thecreems.com... > 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. > Notice that I used the word "warning." An Ada compiler can detect a lot of information due to very nature of the language. In fact, one of the design goals of Ada is to detect the maximum number of errors as early in the development process as possible. Consider the following code: with Ada.Integer_Text_IO; procedure Unitialized_Variable is function F1 (A : Integer; B : Float) return Float is Temp : Float; begin return Temp; end F1; X, Y, Z : Integer; -- unitialized variables begin Y := X; Ada.Integer_Text_IO.Get(X); Z := X; end Unitialized_Variable; The compiler issues a warning, "...X may be used before it has a value." For the function, it issues a warning that we have never referenced the parameters A and B. It also warns me that Temp is never assigned a value. These are not a fatal errors. The Ada Language Reference manual does not require this warning. However, as mentioned above, the design of the language makes it easy to issue such warnings. Those of use who use Ada quite a bit are happy to have a language which provides the maximum of information we need to avoid making foolish mistakes. This may not be the case with other languages, but it is the case with Ada. Richard Riehle