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 r12-4111] [Ada] VxWorks inconsistent use of return type Fixup
Date: Mon,  4 Oct 2021 08:47:28 +0000 (GMT)	[thread overview]
Message-ID: <20211004084728.C7256385843B@sourceware.org> (raw)

https://gcc.gnu.org/g:d681ce903bffa9b5ac19fa7ffb721e55043a0fcc

commit r12-4111-gd681ce903bffa9b5ac19fa7ffb721e55043a0fcc
Author: Doug Rupp <rupp@adacore.com>
Date:   Fri Aug 20 08:26:58 2021 -0700

    [Ada] VxWorks inconsistent use of return type Fixup
    
    gcc/ada/
    
            * libgnarl/s-osinte__vxworks.ads (tlsKeyCreate): Return int.
            * libgnarl/s-tpopsp__vxworks-rtp.adb (ERROR): Declare from
            System.VxWorks.Ext.ERROR.
            (Initialize): Declare IERR. Assert it.
            * libgnarl/s-tpopsp__vxworks.adb (ERROR): Declare from
            System.VxWorks.Ext.ERROR.
            (Is_Valid_Task): Declare IERR. Test return.
            * libgnarl/s-vxwext__kernel.adb (semDelete): Return STATUS.

Diff:
---
 gcc/ada/libgnarl/s-osinte__vxworks.ads     | 2 +-
 gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb | 5 ++++-
 gcc/ada/libgnarl/s-tpopsp__vxworks.adb     | 5 ++++-
 gcc/ada/libgnarl/s-vxwext__kernel.adb      | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.ads b/gcc/ada/libgnarl/s-osinte__vxworks.ads
index a63b9223d6a..e85164587d2 100644
--- a/gcc/ada/libgnarl/s-osinte__vxworks.ads
+++ b/gcc/ada/libgnarl/s-osinte__vxworks.ads
@@ -340,7 +340,7 @@ package System.OS_Interface is
    --  Can only be called from the VxWorks 6 run-time libary that supports
    --  tlsLib, and not by the VxWorks 6.6 SMP library
 
-   function tlsKeyCreate return STATUS;
+   function tlsKeyCreate return int;
    pragma Import (C, tlsKeyCreate, "tlsKeyCreate");
 
    function tlsValueGet (key : int) return System.Address;
diff --git a/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb b/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb
index e5d4089b7d2..1343f6b1c14 100644
--- a/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb
+++ b/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb
@@ -35,6 +35,8 @@
 separate (System.Task_Primitives.Operations)
 package body Specific is
 
+   ERROR : constant STATUS := System.VxWorks.Ext.ERROR;
+
    ATCB_Key : int := 0;
    --  Key used to find the Ada Task_Id associated with a thread
 
@@ -43,9 +45,10 @@ package body Specific is
    ----------------
 
    procedure Initialize is
+      IERR : constant := -1;
    begin
       ATCB_Key := tlsKeyCreate;
-      pragma Assert (ATCB_Key /= ERROR);
+      pragma Assert (ATCB_Key /= IERR);
    end Initialize;
 
    -------------------
diff --git a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
index 2d7cf00edf1..9dc5d8b7bb7 100644
--- a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
+++ b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
@@ -35,6 +35,8 @@
 separate (System.Task_Primitives.Operations)
 package body Specific is
 
+   ERROR  : constant STATUS := System.VxWorks.Ext.ERROR;
+
    ATCB_Key : aliased System.Address := System.Null_Address;
    --  Key used to find the Ada Task_Id associated with a thread
 
@@ -70,8 +72,9 @@ package body Specific is
    -------------------
 
    function Is_Valid_Task return Boolean is
+      IERR : constant := -1;
    begin
-      return taskVarGet (taskIdSelf, ATCB_Key'Access) /= ERROR;
+      return taskVarGet (taskIdSelf, ATCB_Key'Access) /= IERR;
    end Is_Valid_Task;
 
    ---------
diff --git a/gcc/ada/libgnarl/s-vxwext__kernel.adb b/gcc/ada/libgnarl/s-vxwext__kernel.adb
index b3b7f5415d2..2f00059dd34 100644
--- a/gcc/ada/libgnarl/s-vxwext__kernel.adb
+++ b/gcc/ada/libgnarl/s-vxwext__kernel.adb
@@ -59,7 +59,7 @@ package body System.VxWorks.Ext is
    ---------------
 
    function semDelete (Sem : SEM_ID) return STATUS is
-      function Os_Sem_Delete (Sem : SEM_ID) return int;
+      function Os_Sem_Delete (Sem : SEM_ID) return STATUS;
       pragma Import (C, Os_Sem_Delete, "semDelete");
    begin
       return Os_Sem_Delete (Sem);


                 reply	other threads:[~2021-10-04  8:47 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=20211004084728.C7256385843B@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).