svn commit: r223877 - in head: include/rpc lib/libc/xdr

Bruce Evans brde at optusnet.com.au
Sun Jul 10 08:12:38 UTC 2011


On Sun, 10 Jul 2011, Kevin Lo wrote:

> On Sun, 2011-07-10 at 03:45 +1000, Bruce Evans wrote:
>> On Sat, 9 Jul 2011, Kevin Lo wrote:
>>
>>> Log:
>>>  - Add xdr_sizeof(3) to libc
>>>  - Document xdr_sizeof(3); from NetBSD
>>>
>>>  Discussed with:	kib
>>
>> Any reason to further break the style of every changed line of the header?
>
> Does it break style(9)?

Of course.  I gave the details.  style(9) doesn't give any examples of
excessive indentation, although its exact rules for indentation became
hard to see when it was mangled to become a man page (the mangling gives
it the usual 5 space margins of man pages, so a 1 tab indentation becomes
13 space position which is reasonably well rendered as 1 tab followed by 
5 spaces, but this destroys the literal tab structure of the source style).

>>> Modified: head/include/rpc/xdr.h
>>> ==============================================================================
>>> --- head/include/rpc/xdr.h	Fri Jul  8 20:41:12 2011	(r223876)
>>> +++ head/include/rpc/xdr.h	Sat Jul  9 07:43:56 2011	(r223877)
>>> @@ -285,43 +285,46 @@ struct xdr_discrim {
>>>  * These are the "generic" xdr routines.
>>>  */
>>> __BEGIN_DECLS
>>> -extern bool_t	xdr_void(void);
>>> -extern bool_t	xdr_int(XDR *, int *);
> [...]
>>
>> Old brokenness: bogus externs (they have no effect, except for some
>> pre-K&R compilers, but even support for K&R was dropped long ago).

style(9) and even xdr's own man page gives examples of the correct
number of externs to use in prototypes (none).  Like most of style(9),
this rule is not explicitly stated but is only given as an example
(by not using it).

>> Another man page, rpc.3, says that the xdr's x_inline function pointer
>> is for a function that returns `long *'.  This is inconsistent with
>> the int32_t returns for the xdr x_inline function remarked on above.
>> It is also inconsistent with the actual declaration of the x_inline
>> function pointer in xdr.h.  That uses int32_t too.  It was changed to
>> use int32_t instead of long in 1996.
>
> Patches are welcome. Thanks!

The patches are trivial except for man pages and type errors.  First put
almost everything back to where it was so that there is only 1 line of new
style bugs...  Removing all the externs is optional.  I don't like to
create large diffs even to remove such style bugs.  You created large
diffs to add nearby style bugs (the extra tabs).

Bruce


More information about the svn-src-all mailing list