From: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
To: Michal Marek <mmarek-AlSwsSmVLrQ@public.gmane.org>
Cc: Guillem Jover <guillem-+FW4gsLVM0RAfugRpC6u6w@public.gmane.org>,
Jonathan Nieder
<jrnieder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kbuild-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Use __unused0 instead of __unused for user visible struct member names
Date: Wed, 4 Jan 2012 14:35:22 +0100 [thread overview]
Message-ID: <20120104133522.GA7147@merkur.ravnborg.org> (raw)
In-Reply-To: <4F0431F4.4050303-AlSwsSmVLrQ@public.gmane.org>
On Wed, Jan 04, 2012 at 12:03:16PM +0100, Michal Marek wrote:
> On 4.1.2012 09:14, Guillem Jover wrote:
> > On Tue, 2012-01-03 at 07:56:59 +0100, Sam Ravnborg wrote:
> >> On Mon, Jan 02, 2012 at 02:22:43PM -0600, Jonathan Nieder wrote:
> >>> Guillem Jover wrote:
> >>>> On BSD systems __unused has traditionally been defined to mean the
> >>>> equivalent of gcc's __attribute__((__unused__)), some parts of the
> >>>> Linux tree use that convention too (e.g. perf). The problem comes when
> >>>> defining such macro while trying to build unmodified source code with
> >>>> BSD origins on systems with Linux headers.
> >>>>
> >>>> Rename the user visible struct members from __unused to __unused0 to
> >>>> not cause compilation failures due to that macro, which should not be
> >>>> a problem as those members are supposed to be private anyway.
> >>
> >> ^__ is reserved for libc internal stuff and there is no reason to
> >> name the unused/padding members "__unused".
> >> So one or a set of patches that rename them all to something more
> >> sensible would be fine.
> >
> > On a quick glance, I've found other functionally similar struct
> > member names present on the tree:
> >
> > __unused __unusedN __reserved __reservedN __reserved_N __resN
> > __pad __padN __flr_pad __ifi_pad __tcpm_padN __tcpct_padN
> >
> > Do you mean you'd like to see patch(es) to rename all those? I'd not
> > mind providing them, although my immediate concern right now is just
> > regarding __unused.
>
> __.* and _[A-Z].* are reserved for the implementation. Unfortunately,
> both the kernel userspace headers and the libc are part of the
> implementation, so there needs to be some common sense applied to avoid
> clashes. IMO renaming __unused to __unused0 on the basis that some
> headers define __unused to __attribute__((__unused__)) makes sense, but
> blindly renaming any occurence of double underscore helps little.
Agree on Michael on this.
Sam
next prev parent reply other threads:[~2012-01-04 13:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120102024418.GA10483@gaara.hadrons.org>
2012-01-02 20:22 ` [PATCH] Use __unused0 instead of __unused for user visible struct member names Jonathan Nieder
[not found] ` <20120102202243.GA31103-E4JsH6yu/ca99If2fRKg35Ea+QML8DWm@public.gmane.org>
2012-01-03 6:56 ` Sam Ravnborg
2012-01-04 8:14 ` Guillem Jover
2012-01-04 11:03 ` Michal Marek
[not found] ` <4F0431F4.4050303-AlSwsSmVLrQ@public.gmane.org>
2012-01-04 13:35 ` Sam Ravnborg [this message]
[not found] ` <20120103065659.GA32216-OoSGOWW0KRunlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2013-11-11 14:59 ` Thorsten Glaser
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=20120104133522.GA7147@merkur.ravnborg.org \
--to=sam-uyr5n9q2vtjg9huczpvpmw@public.gmane.org \
--cc=guillem-+FW4gsLVM0RAfugRpC6u6w@public.gmane.org \
--cc=jrnieder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kbuild-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mmarek-AlSwsSmVLrQ@public.gmane.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 NNTP newsgroup(s).