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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:b789:: with SMTP id h131mr392659iof.113.1558448556118; Tue, 21 May 2019 07:22:36 -0700 (PDT) X-Received: by 2002:a9d:5f04:: with SMTP id f4mr338220oti.240.1558448555923; Tue, 21 May 2019 07:22:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.166.215.MISMATCH!u76no182322ita.0!news-out.google.com!l135ni224itc.0!nntp.google.com!u76no182318ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 21 May 2019 07:22:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=158.110.245.106; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 158.110.245.106 References: <9ad71ff8-71c6-436c-9a56-f9637565d99a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to put main procedure in SPARK_Mode? From: mockturtle Injection-Date: Tue, 21 May 2019 14:22:36 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56356 Date: 2019-05-21T07:22:35-07:00 List-Id: On Tuesday, May 21, 2019 at 4:14:44 PM UTC+2, Simon Wright wrote: > mockturtle writes: > > > I am fooling around with SPARK (I always wanted to learn to use it) > > and I want to put the "main" procedure (that is in a body file of its > > own) in SPARK_Mode, but with no success so far. > > > > I tried many things including (but not limited to :-)) > > > > * Using Pragma SPARK_Mode (with and without "On") at the beginning of > > the file > > > > * Using Pragma SPARK_MODE after the "is" > > > > * Using > > procedure Main with SPARK_Mode => is .... > > > > and other variations that I do not remember. > > > > The only way I was able to put the procedure in SPARK mode is by > > putting it into a package, but in this way it cannot be the "main" > > (right?). I solved the problem by having a microscopic main procedure > > whose only action is to call the true main in the package, but it > > seems to me less than ideal... > > > > Any suggestions? > > I just tried > > project Spark_Main is > for Source_Files use ("spark_main.adb"); > end Spark_Main; > > and > > procedure Spark_Main with SPARK_Mode is > begin > null; > end Spark_Main; > > and it worked OK. I know it sounds crazy, but I am pretty sure I tried this too... There is maybe a difference... I do not know if it is important, but in my setup the main procedure is a child of a "big root package" (this is a setup that I usually find convenient). Could this be the difference? I'll try later.