Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Dec 1997 11:02:36 +0100 (MET)
From:      j@uriah.heep.sax.de (J Wunsch)
To:        freebsd-current@freebsd.org
Subject:   Re: Bruce vandalism again
Message-ID:  <199712211002.LAA00388@uriah.heep.sax.de>
References:  <199712201434.JAA00329@dyson.iquest.net> <14545.882642903@time.cdrom.com> <19971221120534.43478@lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Greg Lehey <grog@lemis.com> wrote:

>   But the question of consistency brings with it the question
> of what kind of consistency.

Self-consistency, inside one file.

>  Since ANSI C prototypes enable more
> error checking than (voluntary) K&R prototypes, I consider them a Good
> Thing.

Old-style function declarations weren't called `prototype'.

> int	ether_ioctl __P((struct ifnet *, int, caddr_t));
> 
> It's a lot easier to prove consistency if the declaration and
> definition use the same kind of prototype.

Definitions aren't called prototypes either.  It's quite normal that
if your definition is old-style, the declaration would still be
prototyped on a compiler that defines __STDC__ (via __P()).  At least,
potential `consumers' of the declaration (those who include the .h
file) will see the proper prototype, so they benefit from the
typechecking nevertheless, even though the definition is old-style.  I
think gcc even warns some (all?) possible problems iff the old-style
definition is inconsistent with the ANSI prototype (from the .h file).

> About the only plausible argument I've seen in favour of the K&R style
> is (from Bruce) that it makes importing 4.4BSD Lite 2 easier.

The main point is that it makes it easier to find the functional
differences when cvs diffing against the vendor branches, or when
diffing the files against the Net/OpenBSD versions.

We'll need some policy decision that makes it clear when it's OK to
move an entire file to ANSI declarations.  Mixed declaration styles
inside the same file have never been encouraged.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712211002.LAA00388>