public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/14195] New: Suggestion for System.OS_Interface.struct_sigaction
@ 2004-02-18 16:31 oliver dot kellogg at sysde dot eads dot net
  2004-02-18 16:59 ` [Bug ada/14195] " charlet at gcc dot gnu dot org
  2004-02-20 11:27 ` oliver dot kellogg at sysde dot eads dot net
  0 siblings, 2 replies; 3+ messages in thread
From: oliver dot kellogg at sysde dot eads dot net @ 2004-02-18 16:31 UTC (permalink / raw)
  To: gcc-bugs

This is a wish, not a bug.
It applies to all recent versions of GNAT up to and including GNU
CVS mainline of 2004/02/18.

The type struct_sigaction in package System.OS_Interface is
defined as follows:

   type struct_sigaction is record
      sa_handler : System.Address;
      sa_mask    : sigset_t;
      sa_flags   : int;
   end record;
   pragma Convention (C, struct_sigaction);

I suggest making the sa_mask component aliased, i.e.

      sa_mask    : aliased sigset_t;

Reason: The common use case is to create a sigset_t using the

   function sigemptyset (set : access sigset_t) return int;

or other function from the same package.
If the sa_mask component in struct_sigaction is made aliased
then the usage is simplified:

   declare
      sa : struct_sigaction;
      retval : int := sigemptyset (sa.sa_mask'access);
   begin
      ...
   end;

Without the aliasing, it is necessary to use a separate
temporary variable for the sigset_t:

   declare
      temp_sigset : aliased sigset_t;
      sa : struct_sigaction;
      retval : int := sigemptyset (temp_sigset'access);
   begin
      sa.sa_mask := temp_sigset;
   end;


Thanks.

-- 
           Summary: Suggestion for System.OS_Interface.struct_sigaction
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oliver dot kellogg at sysde dot eads dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: -
  GCC host triplet: -
GCC target triplet: i386-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14195


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/14195] Suggestion for System.OS_Interface.struct_sigaction
  2004-02-18 16:31 [Bug ada/14195] New: Suggestion for System.OS_Interface.struct_sigaction oliver dot kellogg at sysde dot eads dot net
@ 2004-02-18 16:59 ` charlet at gcc dot gnu dot org
  2004-02-20 11:27 ` oliver dot kellogg at sysde dot eads dot net
  1 sibling, 0 replies; 3+ messages in thread
From: charlet at gcc dot gnu dot org @ 2004-02-18 16:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From charlet at gcc dot gnu dot org  2004-02-18 16:59 -------
That would indeed allow some clean ups in various gnat run time files.
Feel free so submit a patch to that effect.

Arno

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14195


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/14195] Suggestion for System.OS_Interface.struct_sigaction
  2004-02-18 16:31 [Bug ada/14195] New: Suggestion for System.OS_Interface.struct_sigaction oliver dot kellogg at sysde dot eads dot net
  2004-02-18 16:59 ` [Bug ada/14195] " charlet at gcc dot gnu dot org
@ 2004-02-20 11:27 ` oliver dot kellogg at sysde dot eads dot net
  1 sibling, 0 replies; 3+ messages in thread
From: oliver dot kellogg at sysde dot eads dot net @ 2004-02-20 11:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From oliver dot kellogg at sysde dot eads dot net  2004-02-20 11:26 -------
After talking to Arno, it seems that this change would require to
fully retest all signal handling related functions that take a
struct_sigaction on all supported platforms.
That is something I cannot do and I therefore retire the request.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14195


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-20 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-18 16:31 [Bug ada/14195] New: Suggestion for System.OS_Interface.struct_sigaction oliver dot kellogg at sysde dot eads dot net
2004-02-18 16:59 ` [Bug ada/14195] " charlet at gcc dot gnu dot org
2004-02-20 11:27 ` oliver dot kellogg at sysde dot eads dot net

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