public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2848] ada: Add an assert in Posix Interrupt_Wait
@ 2023-07-28  7:31 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-07-28  7:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9c70186d84b895340771fcf9df54e3ed6f1a4e48

commit r14-2848-g9c70186d84b895340771fcf9df54e3ed6f1a4e48
Author: Clément Chigot <chigot@adacore.com>
Date:   Tue Jun 13 10:51:17 2023 +0200

    ada: Add an assert in Posix Interrupt_Wait
    
    All functions but Interrupt_Wait in s-inmaop__posix are checking the
    result of their syscalls with an assert. However, any return code of
    sigwait different than 0 means that something went wrong for it.
    
    From sigwait man:
    > RETURN VALUE
    >      On success, sigwait() returns 0.  On  error,  it  returns  a
    >      positive error number (listed in ERRORS).
    
    gcc/ada/
    
            * libgnarl/s-inmaop__posix.adb: Add assert after sigwait in
            Interrupt_Wait

Diff:
---
 gcc/ada/libgnarl/s-inmaop__posix.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/libgnarl/s-inmaop__posix.adb b/gcc/ada/libgnarl/s-inmaop__posix.adb
index 3171399f982..e4d07ee77eb 100644
--- a/gcc/ada/libgnarl/s-inmaop__posix.adb
+++ b/gcc/ada/libgnarl/s-inmaop__posix.adb
@@ -135,6 +135,7 @@ package body System.Interrupt_Management.Operations is
 
    begin
       Result := sigwait (Mask, Sig'Access);
+      pragma Assert (Result = 0);
 
       if Result /= 0 then
          return 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-28  7:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  7:31 [gcc r14-2848] ada: Add an assert in Posix Interrupt_Wait Marc Poulhi?s

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