From: digitig <digitig@gmail.com>
Subject: Re: How do I resolve SPARK warning "procedure [...] has no effect for output procedure
Date: Wed, 25 Mar 2020 17:45:47 -0700 (PDT)
Date: 2020-03-25T17:45:47-07:00 [thread overview]
Message-ID: <f9bf574c-af41-4d66-8c22-d4e83ed8ab7a@googlegroups.com> (raw)
In-Reply-To: <2cf70068-45e1-4e39-8ff4-3348f37e63fd@googlegroups.com>
On Wednesday, March 25, 2020 at 11:38:06 PM UTC, Anh Vo wrote:
> Would you mind to post the source code and the warning message. So, every one is at the page.
Ok, here's a simplified thing that gives the same issue:
Suppose I've got a naive error logging procedure (to isolate the use of Standard_Error, which Spark doesn't like and I don't know how to get at the underlying file in Ada yet):
with Ada.Text_IO; use Ada.Text_IO;
package body Logging is
procedure Log_Error(Message: String) with SPARK_Mode => Off is
begin
Put_Line(Standard_Error, Message);
end Log_Error;
end Logging;
As you can see, SPARK is turned off for that. Then I have (simplified) :
with Logging; use Logging;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
package body Utils is
procedure Error_Header is
begin
Log_Error
("This is the standard header I want for the Standard_Error output" &
LF);
end Error_Header;
end Utils;
When I run SPARK examiner (from within GPS) I Get the warning I'd like to clear:
warning: subprogram "Error_Header" has no effect.
next prev parent reply other threads:[~2020-03-26 0:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 20:48 How do I resolve SPARK warning "procedure [...] has no effect for output procedure digitig
2020-03-25 23:38 ` Anh Vo
2020-03-26 0:45 ` digitig [this message]
2020-03-26 10:02 ` Simon Wright
2020-03-26 11:56 ` digitig
2020-03-26 13:13 ` Egil H H
2020-03-27 0:05 ` digitig
2020-03-26 15:36 ` Simon Wright
2020-03-26 12:04 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox