]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Annotate GNAT.Sockets with No_Return aspects
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 6 Jun 2022 14:41:32 +0000 (16:41 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 5 Jul 2022 08:28:19 +0000 (08:28 +0000)
Opportunity for extra annotations spotted while fixing detection of
unreachable code that follows calls to procedures annotated with
No_Return.

gcc/ada/

* libgnat/g-socket.adb (Raise_Host_Error): Add No_Return aspect.
(Raise_GAI_Error): Likewise.
* libgnat/g-socket.ads (Raise_Socket_Error): Likewise.

gcc/ada/libgnat/g-socket.adb
gcc/ada/libgnat/g-socket.ads

index 12abb683bb0b603e33f935bf31a657a89ce3331b..4267d9f408fd18389f832de1ad59c9f29e9e9f99 100644 (file)
@@ -191,12 +191,14 @@ package body GNAT.Sockets is
        else Value);
    --  Removes dot at the end of error message
 
-   procedure Raise_Host_Error (H_Error : Integer; Name : String);
+   procedure Raise_Host_Error (H_Error : Integer; Name : String)
+   with No_Return;
    --  Raise Host_Error exception with message describing error code (note
    --  hstrerror seems to be obsolete) from h_errno. Name is the name
    --  or address that was being looked up.
 
-   procedure Raise_GAI_Error (RC : C.int; Name : String);
+   procedure Raise_GAI_Error (RC : C.int; Name : String)
+   with No_Return;
    --  Raise Host_Error with exception message in case of errors in
    --  getaddrinfo and getnameinfo.
 
index 41ede44ef69e724197152bb953974edf690a3cb6..cfc47bea7f9b72a998ac61f0eac5b47529c547a6 100644 (file)
@@ -1593,7 +1593,7 @@ private
    Wait_For_A_Full_Reception : constant Request_Flag_Type := 4;
    Send_End_Of_Record        : constant Request_Flag_Type := 8;
 
-   procedure Raise_Socket_Error (Error : Integer);
+   procedure Raise_Socket_Error (Error : Integer) with No_Return;
    --  Raise Socket_Error with an exception message describing the error code
    --  from errno.