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: a07f3367d7,cbe0aa3013785791 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z9g2000yqi.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Minor SPARK problem concerning 'redundant' with clauses. Date: Wed, 10 Jun 2009 13:11:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 82.20.239.89 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244664716 25419 127.0.0.1 (10 Jun 2009 20:11:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Jun 2009 20:11:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z9g2000yqi.googlegroups.com; posting-host=82.20.239.89; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6419 Date: 2009-06-10T13:11:56-07:00 List-Id: On Jun 10, 8:31=A0pm, xorquew...@googlemail.com wrote: > I have a package P1 that uses the value of a constant defined in P2. > > SPARK requires me to --# inherit P2 and the only place the annotation > can appear is in the spec of P1. The Ada compiler, however, sees that > the constant is only referenced in the body and complains loudly that > the 'with' clause is redundant and might be moved into the body of P2. > > Is there a sensible solution to stop the two systems treading on each > other like this? In most cases, I can hack around the problem with a > spurious 'use type' clause (as much as I dislike it). You could explore the options available with -gnatw, perhaps? None look appropriate at first glance, but ..