Subject: Style guide
To: None <current-users@NetBSD.ORG>
From: D'Arcy J.M. Cain <darcy@druid.net>
List: current-users
Date: 05/27/1997 09:46:11
Recently I sent in a bunch of changes to ftpd which documented an existing
option and added a new one.  While I was at it I cleaned up a bunch of the
code making all the functions ANSI style as well as a few other cleanups.
This latter was rejected based on the existing style guide which is in
/usr/share/misc/style.  I wonder if it isn't time to revisit this style
guide.  It doesn't make a lot of sense to me that we have to be backwards
compatible to older compilers when we will never compile NetBSD with anything
but the Gnu compiler that it comes with.  Here are the changes that I think
would make sense.

51,53c51,52
<  * elsewhere) go at the top of the source module.  Use the __P macro from
<  * the include file <sys/cdefs.h>.  Only the kernel has a name associated with
<  * the types, i.e. in the kernel use:
---
>  * elsewhere) go at the top of the source module.  Only the kernel has a name
>  * associated with the types, i.e. in the kernel use:
55c54
<  *	void function __P((int a));
---
>  *	void function(int a);
59c58
<  *	void function __P((int));
---
>  *	void function(int);
61,62c60,61
< static char	*function __P((int, const char *));
< static void	 usage __P((void));
---
> static char	*function(int, const char *);
> static void	 usage(void);
108,110c107
< main(argc, argv)
< 	int argc;
< 	char *argv[];
---
> main(int argc, char **argv)
208,210c205
< function(a1, a2, fl, a4)
< 	int a1, a2, a4;	/* Declare ints, too, don't default them. */
< 	float fl;	/* List in order declared, as much as possible. */
---
> function(int a1, int a2, float fl, int a4)
267d261
< #if __STDC__
269,271d262
< #else
< #include <varargs.h>
< #endif
274d264
< #if __STDC__
276,280d265
< #else
< vaf(fmt, va_alist)
< 	char *fmt;
< 	va_dcl
< #endif
283d267
< #if __STDC__
285,287d268
< #else
< 	va_start(ap);
< #endif
294c275
< usage()
---
> usage(void)

-- 
D'Arcy J.M. Cain                           |  Democracy is three wolves
darcy@{druid.net|vex.net}                  |  and a sheep voting on         
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.
                --  http://www.druid.net/darcy  --