aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-06-06 16:41:32 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-05 08:28:19 +0000
commit5c0729d2edbc963e5bdea29547aa7b0c751cb491 (patch)
tree02e46aec088ecb7cf2426ba55a124eed6bb656cc /gcc
parentdd1c3433aa93d70d41d6c6cc1836249396413eab (diff)
downloadgcc-5c0729d2edbc963e5bdea29547aa7b0c751cb491.zip
gcc-5c0729d2edbc963e5bdea29547aa7b0c751cb491.tar.gz
gcc-5c0729d2edbc963e5bdea29547aa7b0c751cb491.tar.bz2
[Ada] Annotate GNAT.Sockets with No_Return aspects
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/libgnat/g-socket.adb6
-rw-r--r--gcc/ada/libgnat/g-socket.ads2
2 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb
index 12abb68..4267d9f 100644
--- a/gcc/ada/libgnat/g-socket.adb
+++ b/gcc/ada/libgnat/g-socket.adb
@@ -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.
diff --git a/gcc/ada/libgnat/g-socket.ads b/gcc/ada/libgnat/g-socket.ads
index 41ede44..cfc47be 100644
--- a/gcc/ada/libgnat/g-socket.ads
+++ b/gcc/ada/libgnat/g-socket.ads
@@ -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.