style(9) manpage __P removal
ibotty
bsd at ibotty.net
Tue Sep 23 07:00:23 PDT 2003
> :Speaking of style how do people feel about K&R declarations?
> :I'm wondering if I'm the only one that thinks that retaining
> :them is silly.
> :
> :-Kip
>
> I have been replacing them with their ANSI equivalents as I have come
> across them.
i have update my patch (ehm, well...), to also reflect this cleanup.
matt, you will find some of the formulations familiar ;-).
> int
> fubar(int a, int b, int c, int d, int e, int f, int g, int h, int i,
> int j, int k, int l, int m)
> {
> }
>
> But its up to you. I have no strong opinion either way (other then
> additional lines being indented somehow).
i have not included a guideline then.
~ibottyIndex: style.9
===================================================================
RCS file: /home/src/dcvs/src/share/man/man9/style.9,v
retrieving revision 1.3
diff -u -3 -p -r1.3 style.9
--- style.9 14 Aug 2003 18:28:48 -0000 1.3
+++ style.9 23 Sep 2003 13:54:57 -0000
@@ -252,17 +252,21 @@ Functions that are used locally in more
separate header file, e.g.\&
.Qq Pa extern.h .
.Pp
-Only use the
+Never use the
.Dv __P
macro from the include file
.Aq Pa sys/cdefs.h
-if the source
-file in general is (to be) compilable with a K&R Old Testament compiler.
+in new source
+files, even if it is (to be) compilable with a K&R Old Testament compiler.
Use of the
.Dv __P
-macro in new code is discouraged, although modifications
-to existing files should be consistent with that file's conventions.
+macro in legacy code is also highly discouraged, even minor changes
+to existing code should remove these macros.
.Pp
+You should not use K&R declarations either. When replacing them with their
+ANSI equivalent, beware of arguments, that are out of order.
+.Pp
+Nevertheless, modifications to existing files should be consistent with that file's conventions.
In general code can be considered
.Dq "new code"
when it makes up about 50% or more of the file(s) involved.
More information about the Submit
mailing list