This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use __unused.0 instead of __unused for user visible struct members
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Justin Cormack <justin at specialbusservice dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Tue, 26 Nov 2013 12:33:31 +0100
- Subject: Re: [PATCH] Use __unused.0 instead of __unused for user visible struct members
- Authentication-results: sourceware.org; auth=none
- References: <CAK4o1WzkMk8nV2jzM38peutbMWuKBPTeh5dbfwSiDhankAT=Yw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1310281328500 dot 25699 at digraph dot polyomino dot org dot uk> <CAK4o1WxO9=qbKUiJtZtS+Q9Wyo8EfNrO_H8=J_w=zcQP822Dvw at mail dot gmail dot com> <20131105135404 dot GA20687 at domone dot podge> <528303CA dot 3050901 at redhat dot com> <20131113110951 dot GA2926 at domone dot podge> <5283AF16 dot 9010407 at redhat dot com> <CAK4o1Wz+HbUfJe_F4ZMmz_fVpMUaOBhXrL=uN_GjTBFugr+ZkA at mail dot gmail dot com> <5293C0B2 dot 80003 at redhat dot com>
On Mon, Nov 25, 2013 at 04:27:14PM -0500, Carlos O'Donell wrote:
> On 11/25/2013 04:21 AM, Justin Cormack wrote:
> > On Wed, Nov 13, 2013 at 4:55 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> >> On 11/13/2013 06:09 AM, OndÅej BÃlka wrote:
> >>> On Tue, Nov 12, 2013 at 11:44:58PM -0500, Carlos O'Donell wrote:
> >>>> On 11/05/2013 08:54 AM, OndÅej BÃlka wrote:
> >>>>> On Mon, Oct 28, 2013 at 03:41:18PM +0000, Justin Cormack wrote:
> >>>>>> On Mon, Oct 28, 2013 at 1:30 PM, Joseph S. Myers
> >>>>>> <joseph@codesourcery.com> wrote:
> >>>>>>> On Mon, 28 Oct 2013, Justin Cormack wrote:
> >>>>>>>
> >>>>>>>> A patch was submitted for this a while back
> >>>>>>>> https://sourceware.org/ml/libc-alpha/2012-01/msg00001.html and did not
> >>>>>>>> get a good reception from the maintainer at the time. Attached is an
> >>>>>>>> updated version for current glibc head.
> >>>>>>>
> >>>>>>> I believe we had consensus on use of __glibc_reserved as a prefix in such
> >>>>>>> cases (allowing for __glibc_reserved0, __glibc_reserved1 or
> >>>>>>> __glibc_reserved_foo, __glibc_reserved_bar in cases where more than one
> >>>>>>> identifier, or a more meaningful name, is needed).
> >>>>>>
> >>>>>> OK, that makes sense, found part of that conversation in the archives.
> >>>>>> Here is a patch (inline and attached) to convert all uses to
> >>>>>> __glibc_reserved.
> >>>>>>
> >>>>>> Justin
> >>>>>>
> >>>>> A mechanical change that looks ok,
> >>>>>
> >>>>> It needs changelog so I generated following.
> >>>>
> >>>> Could you please repost with the patch and final ChangeLog,
> >>>> TO me, CC libc-alpha, and I'll review.
> >>>>
> >>>> Cheers,
> >>>> Carlos.
> >>>>
> >>> Here
> >>
> >> OK to checkin as long as you do 2 more things please:
> >>
> >> 1. Email libc-ports and explain that you've made cross-machine
> >> changes and renamed __unused to __glibc_reserved and to look
> >> for any unintended breakage.
> >>
> >> 2. Update https://sourceware.org/glibc/wiki/Style_and_Conventions
> >> and add an entry on this to explain that we use __glibc_reserved
> >> for unused structure entries and that this is done to avoid
> >> __unused which causes problems with BSD sources.
> >
> > I have done 1. I don't have permission to edit that wiki page (user
> > JustinCormack). I suggest something like:
> >
> > == Unused structure members ==
> >
> > Structure members that are not used, but inserted for padding,
> > alignment and future use reasons, should be named '__glibc_reserved'
> > or numbered with 'glibc_reserved1', 'glibc_reserved2' in the case of
> > multiple parameters. This form should be used instead of the historic
> > '__unused' as this conflicts with the use of '__unused' in BSD code.
> > These structure members should not be used in user code, as they are
> > subject to change and vary by architecture and are reserved for the
> > implementation.
>
> Justin,
>
> Thanks. I've added you to the EditorGroup so you can change
> the wiki, but given that I've checked in the __block fixes for Clang's
> -fblock extension I'd already added a paragraph about this. Thus I
> don't think there is anything else to do but checkin the patch.
>
> Ondrej,
>
> Would you like to check this in? Otherwise I can do it.
>
Sure, I pushed that now. I was occupied by other things last week.