Re: RFC: Port of NetBSD cat(1)'s -f option.

Peter Pentchev <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
On Thu, May 16, 2002 at 03:02:13PM +0200, Dag-Erling Smorgrav wrote:
> Giorgos Keramidas <[email protected]> writes:
> > I'm not sure.  The < 0 check is almost hardwired in my fingers,
> > because of a few years of writing it this way.  Just trying to be on
> > the safe side of the world, I guess.
> 
> It's also a single instruction (+ a flag check) on most architectures,
> while an explicit comparison is at least two, and possibly trashes a
> register.
> 
> That being said, I use == -1 myself - but I don't think < 0 is wrong,
> just different.  As long as we're consistent, I don't care.

It was exactly about being consistent that I first brought this up;
IMO, at least within FreeBSD, being consistent would be == -1.

G'luck,
Peter

-- 
Peter Pentchev	[email protected]	[email protected]
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
What would this sentence be like if it weren't self-referential?
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE846+/7Ri2jRYZRVMRAnP1AJ9ceMF/6Vf6EF7Odn9KEYMnuDyuqgCeOFZD
cDM/GMWWQYaTP7GjeR938Ck=
=LwcT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.