RFC: WARNS=6 patch for libexec/rpc.rstatd

Xin LI delphij at frontfree.net
Thu Jan 20 07:52:56 PST 2005


Hello, everyone,

I have a preliminary patch against rpc.rstatd to get it WARNS=6 clean on
both i386 and all Tier-1 64-bit platforms.  Since I'm not quite familiar
with the rpc* code I would like to solicit a review on the patch, see
attachment.

Changes include:
	- Avoid 64-bit platform complains due to timeval width
	  changes, by introducing an temporary newcurtime when
	  obtaining the current time, since rstat_timeval uses
	  u_int while timeval uses long.  (value could be truncated
	  but that's better than overwriting unwanted area)
	- Use xdrproc_t instead of the more complicated definations
	  (and which doesn't provided enough information for compiler
	  to generate correct code if optimization level is turned
	  too high)
	- Initialize variables that can potentially be used without
	  initialization.
	- Explicitly cast when necessary
	- Use NULL in favor of 0 when representing a NULL pointer
	- Don't use constant strings for initialization of char *
	- Add a missing prototype for rstat_service
	- Prefer complete prototype over incomplete ones.
	- Use static where applicable.
	- Apply __unused on unused parameters
	- Avoid shadowed names
	- Bump WARNS?= from default to 6

Thanks in advance!

Cheers,
-- 
Xin LI <delphij delphij net>  http://www.delphij.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-rpc.rstatd
Type: text/x-patch
Size: 11634 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050120/63001343/patch-rpc.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: 
	=?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?=
	=?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8?= =?UTF-8?Q?=E5=88=86?=
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050120/63001343/attachment.bin


More information about the freebsd-hackers mailing list