From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: calling function but ignoring results Date: Sat, 03 Jul 2021 03:42:41 -0700 Organization: Aioe.org NNTP Server Message-ID: <865yxrispq.fsf@stephe-leake.org> References: <69a59fdc-72bb-4202-99fc-d776530de653n@googlegroups.com> <867diayk1o.fsf@stephe-leake.org> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:zDFV5Hm/rqTBD5BPmHr8iaAr28Q= Xref: reader02.eternal-september.org comp.lang.ada:62324 List-Id: "Randy Brukardt" writes: > "Stephen Leake" wrote in message > news:867diayk1o.fsf@stephe-leake.org... > ... >> declare >> dont_care : BOOLEAN := foo( x, y ); >> pragma Unreferenced (dont_care); >> begin >> null; >> end; >> >> which makes the intent clear. I don't know if Unreferenced was proposed >> as a language addition; it's not in Ada 202x. > > Unreferenced controls warnings, which (with one exception) are not an Ada > concept. This could be another exception, or we could make it an Ada concept. > So how would we describe what it does? Aspect unreferenced does > nothing at all?? :-) > > One could imagine an aspect that caused a Legality Rule against an actual > reference, but I don't think that is what the GNAT aspect does. It does give you a warning if the variable is referenced. -- -- Stephe