Thread (5 messages) 5 messages, 4 authors, 2012-01-04

Re: [PATCH] Use __unused0 instead of __unused for user visible struct member names

From: Guillem Jover <hidden>
Date: 2012-01-04 08:14:25
Also in: linux-kbuild, lkml

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:
quoted
Guillem Jover wrote:
quoted
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.

There's also __buf in linux/sem.h and __data in linux/socket.h, but
I'd rather not thouch those, as I'd expect to be users for them?

thanks,
guillem
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help