public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1486] [Ada] Annotate GNAT.Sockets with No_Return aspects
Date: Tue,  5 Jul 2022 08:30:24 +0000 (GMT)	[thread overview]
Message-ID: <20220705083024.0C404384F02D@sourceware.org> (raw)

https://gcc.gnu.org/g:5c0729d2edbc963e5bdea29547aa7b0c751cb491

commit r13-1486-g5c0729d2edbc963e5bdea29547aa7b0c751cb491
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Jun 6 16:41:32 2022 +0200

    [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.

Diff:
---
 gcc/ada/libgnat/g-socket.adb | 6 ++++--
 gcc/ada/libgnat/g-socket.ads | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb
index 12abb683bb0..4267d9f408f 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 41ede44ef69..cfc47bea7f9 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.


                 reply	other threads:[~2022-07-05  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705083024.0C404384F02D@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).