public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: RFC: fixing signal context namespace issues
Date: Tue, 02 May 2017 16:10:00 -0000	[thread overview]
Message-ID: <CAKCAbMizArGyWrvgtnKF_X+Bra70rtOL8Nku9LdoPFC7hJFjrw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1705021548290.3055@digraph.polyomino.org.uk>

On Tue, May 2, 2017 at 11:53 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 2 May 2017, Zack Weinberg wrote:
>
>> > Note the caveats on platforms using "typedef struct sigcontext
>> > mcontext_t;": (a) as sigcontext is not a reserved name, the C++ mangled
>> > name of mcontext_t would change depending on __USE_MISC,
>>
>> ... that sounds like an unacceptable side effect to me.  I would make
>> the strong claim that the C++ mangled name of a type must never change
>> in response to any user-controlled feature-selection macro, except
>> those that have the specific function of selecting alternative
>> definitions of a particular type (e.g. __USE_FILE_OFFSET64).
>
> Well, an alternative would be to stop including bits/sigcontext.h from
> sys/ucontext.h (absent __USE_MISC, anyway; the inclusion directly from
> signal.h is already conditional on __USE_MISC), and duplicate the
> definition directly in sys/ucontext.h (with or without having the use of
> __ prefixes on field names conditional on !__USE_MISC), so:
>
> typedef struct { ... } mcontext_t;
>
> That would change the mangled name (from "sigcontext" to "mcontext_t"),
> but as an unconditional one-off change (like that when we eliminated the
> "struct siginfo" name some time ago) rather than depending on feature test
> macros.  Of course that would break things for anyone expecting mcontext_t
> and struct sigcontext to be the same type, but as they aren't the same
> type on x86 I doubt people are depending on equality elsewhere.

Modulo details of what goes where, that certainly seems less dangerous
to me, but I think it would still be a good idea to do some sort of
investigation to find out whether anything important will break.  I
don't think these are high-priority namespace issues, so preserving
compatibility seems more important.

zw

      reply	other threads:[~2017-05-02 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 15:39 Joseph Myers
2017-05-02 15:44 ` Zack Weinberg
2017-05-02 15:53   ` Joseph Myers
2017-05-02 16:10     ` Zack Weinberg [this message]

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=CAKCAbMizArGyWrvgtnKF_X+Bra70rtOL8Nku9LdoPFC7hJFjrw@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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).