This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

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.

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.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]