Skip to content

Commit 707e60a

Browse files
committed
Address gnatprove issues in tls client
1 parent 97e731f commit 707e60a

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

wrapper/Ada/tls_client.adb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ package body Tls_Client with SPARK_Mode is
4747
Ada.Text_IO.Put (Text);
4848
end Put;
4949

50-
procedure Put (Number : Natural) is
50+
procedure Put (Number : Natural)
51+
with
52+
Annotate => (GNATprove, Might_Not_Return)
53+
is
5154
begin
5255
Natural_IO.Put (Item => Number, Width => 0, Base => 10);
5356
end Put;
5457

55-
procedure Put (Number : Byte_Index) is
58+
procedure Put (Number : Byte_Index)
59+
with
60+
Annotate => (GNATprove, Might_Not_Return)
61+
is
5662
begin
5763
Natural_IO.Put (Item => Natural (Number), Width => 0, Base => 10);
5864
end Put;
@@ -137,7 +143,7 @@ package body Tls_Client with SPARK_Mode is
137143
Output : WolfSSL.Write_Result;
138144

139145
Result : WolfSSL.Subprogram_Result;
140-
DTLS : Boolean := False;
146+
DTLS : Boolean;
141147
begin
142148
Result := WolfSSL.Initialize;
143149
if Result /= Success then

wrapper/Ada/tls_client.ads

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ package Tls_Client with SPARK_Mode is
3232
Pre => (not Client.Exists and not
3333
WolfSSL.Is_Valid (Ssl) and not WolfSSL.Is_Valid (Ctx)),
3434
Post => (not Client.Exists and not WolfSSL.Is_Valid (Ssl) and
35-
not WolfSSL.Is_Valid (Ctx));
35+
not WolfSSL.Is_Valid (Ctx)),
36+
Annotate => (GNATprove, Might_Not_Return);
3637

3738
end Tls_Client;

0 commit comments

Comments
 (0)