Subject: ANSI vs. K&R
To: None <tech-misc@netbsd.org>
From: Perry E. Metzger <perry@piermont.com>
List: tech-misc
Date: 03/12/1999 15:24:49
Every once in a while we have the ANSI vs. K&R mandatory style
argument in NetBSD. Now that its past the 10th anniversary of the
formal adoption of ANSI C, I thought I'd bring it up again.

Although I think it would be silly to impose ANSI on the kernel and
gratuitously change everything for the sake of changing it, as it
stands, if someone writes ANSI style code (even ANSI code that is
essentially KNF but for the ANSIisms), we carefully go in and do lots
of work de-ANSIfying it before committing it. I think we should
officially adopt a new policy. I'd prefer if we individually
considered all of the following points so we can segregate the flames...

1) We should accept both ANSI and older dual ANSI/K&R style code
provided it is in KNF (with KNF being extended to permit ANSI
prototypes and such -- that usage is actually sort of explained in
share/misc/style already).

I think 1) is fairly easy, though people will doubtless bitch.

2) We should encourage new code to be written in ANSI KNF style.

I think this is likely more controversial.

3) We should slowly allow our tree to get converted to ANSI, starting
first with things like removing __P from prototypes in userland
include files and such, and changing things we are likely to share
with FreeBSD last (assuming we can't get them to do the same thing as
us). The transformation could take place over some years -- no rush
needed.

I think this is most controversial of all.

Comments?

Perry