cvs commit: src/sys/netinet6 frag6.c icmp6.c in6.c in6_ifattach.c in6_pcb.c in6_proto.c in6_rmx.c in6_src.c ip6_input.c ip6_mroute.c ip6_output.c mld6.c nd6.c nd6_nbr.c nd6_rtr.c raw_ip6.c udp6_usrreq.c

M. Warner Losh imp at bsdimp.com
Sat Jan 12 16:38:04 PST 2008


In message: <20080110085803.H66908 at fledge.watson.org>
            Robert Watson <rwatson at FreeBSD.org> writes:
: In the past, we've had several subtle bugs crop up as a result of
: changing to ANSI C function prototypes, which no longer
: automatically promote arguments to int from shorter types (I think
: it's that way around).  This caused some very subtle semantic
: changes in the socket code a few years ago and was a nightmare to
: track down.  Unfortunately, I don't remember the details or I'd dig
: up the commit that fixed it, it was really quite tricky, as what on
: face value was a style change actually changed the semantics
: significantly.

Yes.  The changes there are when the prototype was introduced.  In the
absence of a prototype, all things are promoted to int or long or are
a pointer.  The usual cause for problems is where something was
promoted without sign extension before the prototype, and with sign
extension after (or vice versa).

This is one reason why most kernel files have prototypes at the top of
them for all static functions in the file.  When the prototype is
encountered, it doesn't matter if the definition later in the file is
done in the old style or new style: all functions in the file are
treated the same.

However, that's not what happened here.  Syntactic sugar was removed
that lead to binaries of the same md5.  We need to be careful to not
make too big a deal out of that...

My concern with doing style sweeps now is that it may delay 7.0
getting out, or make it harder than necessary to merge things.  We
should strive to keep them to a minimum unless active work is going on
that isn't going to be merged back into 7.0 anyway (which should be
most things today).

I share the concern for unreviewed changes, and there's no need to
beat on that drum further.

So please read this as a 'now is a good time for a reminder' rather
than a complaint about this specific commit.

Warner



More information about the cvs-src mailing list