svn commit: r356725 - head/usr.bin/diff

Ronald Klop ronald-lists at klop.ws
Wed Jan 15 12:32:10 UTC 2020


 
Van: Baptiste Daroussin <bapt at FreeBSD.org>
Datum: dinsdag, 14 januari 2020 18:10
Aan: Ian Lepore <ian at freebsd.org>
CC: svn-src-head at freebsd.org, svn-src-all at freebsd.org, src-committers at freebsd.org
Onderwerp: Re: svn commit: r356725 - head/usr.bin/diff
> 
> On Tue, Jan 14, 2020 at 08:44:29AM -0700, Ian Lepore wrote:
> > On Tue, 2020-01-14 at 08:22 +0000, Baptiste Daroussin wrote:
> > > Author: bapt
> > > Date: Tue Jan 14 08:22:28 2020
> > > New Revision: 356725
> > > URL: https://svnweb.freebsd.org/changeset/base/356725
> > >
> > > Log:
> > >   When system calls indicate an error they return -1, not some
> > > arbitrary
> > >   value < 0.  errno is only updated in this case.
> > >   
> >
> > What's the point of these changes, other than almost certainly leading
> > to worse code generation?
> >
> > In most instruction sets, you can test for a value < 0 without using
> > any instructions, you only need to examine the condition flags after
> > loading the value.  To compare equal to -1 typically requires at least
> > 1 extra instruction, and on risc architectures typically at least two
> > extra (load -1 to a register then compare).
> >
> our diff has forked from the OpenBSD one. The goal of those patches is to keep
> in sync code that is still close to the original OpenBSD one as much as
> possible.
> 
> Best regards,
> Bapt

This is a nice example that it is valuable to describe in the commit message *why* a commit is made. Or "the goal" of the patches.

Regards,
Ronald.
 


More information about the svn-src-all mailing list