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=2.6 required=5.0 tests=BAYES_20,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!mcsun!ukc!strath-cs!gor From: gor@cs.strath.ac.uk (Gordon Russell) Newsgroups: comp.lang.ada Subject: ADA Compiler Query Message-ID: <5574@baird.cs.strath.ac.uk> Date: 11 Feb 91 15:41:09 GMT Sender: gor@cs.strath.ac.uk Reply-To: gor@cs.strath.ac.uk (Gordon Russell) Organization: Comp. Sci. Dept., Strathclyde Univ., Scotland. List-Id: Hi out there, I am hoping that someone on the network can answer a compiler implementation problem for me. The problem stems from my PhD research into compiler techniques. If we consider the following program extract... variable1 : integer; procedure MAIN is variable1 : integer; result : integer; ---------------------------------------------------- procedure GET_RESULT(variable2: in out integer) is begin variable1=2; variable2=variable1 + variable2; end GET_RESULT; ---------------------------------------------------- begin variable1=10; get_result(variable1); end MAIN; My question is.......what is variable1 equal to at the end of MAIN? There appears to be a number of options....either (1) 4 (2) 12 (3) Something wierd (4) Compiler dependent. Evidentally, it is reliant on whether GET_RESULT operates on variable2 directly or indirectly. I am hoping that the results are compiler dependent. Does anyone have an ADA compiler who is willing to test this? I am especially interested to hear from official sources (if they are reading this), since I do not want to break any validation suite program. Reply either to this newsgroup or by email. I will post a concensus if comments are mailed directly to me. Please no flames if this program is not syntatically correct, as it is the mechanism which I am inquiring after. And yes, I do think that this is poor programming practice, but when has that stopped anyone! Thanx in advance.....Gordon Russell gor@cs.strath.ac.uk