This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use __unused0 instead of __unused for user visible struct members
On Fri, Feb 10, 2012 at 4:09 PM, Roland McGrath <roland@hack.frob.com> wrote:
> The previous discussion was about struct members. ?Parameter names in
> prototypes are a separate issue, on which there has been no direct
> discussion and certainly no consensus about any change.
You're right, we should not mix more than one issue at a time.
Guillem, could you please repost a version of your patch that adjusts
struct members only?
> The reason we use parameter names in prototypes at all is so that reading
> the header files is tractable as some minimal form of documentation, which
> people have always found useful. ?Sometimes the names alone are
> significantly useful. ?Originally, I maintained a good discipline of having
> an explanatory comment before each declaration in the public header files,
> where comments refer to the parameters by name. ?So the names were in the
> prototypes as the referent of the documentary comments.
OK.
> The reason the parameter names in header files are prefixed with __ is for
> necessary name space discipline. ?(An application is free to define a macro
> called "string" or "filename" or any of various other things that are the
> natural and useful thing to use as a parameter name.) ?There is no such
> issue with the libc sources themselves--it applies only to public header
> files. ?So simple good taste and readable style dictate using unadorned and
> explanatory natural names for parameters in function definitions. ?Hence,
> it's normal that a public header will declare a prototype with an argument
> called __foobar and the function itself will be defined with that argument
> called foobar.
That makes sense, but eventually runs afoul of the same problem when
you use __vector, or __block as parameter names.
Let us save this discussion for later when we have resolved the issue
of public structure names.
Cheers,
Carlos.