NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/39684 (RB_REMOVE trashes link to tree, when requested to remove object that isn't in tree)



The following reply was made to PR lib/39684; it has been noted by GNATS.

From: Quentin Garnier <cube%cubidou.net@localhost>
To: Christos Zoulas <christos%zoulas.com@localhost>
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: lib/39684 (RB_REMOVE trashes link to tree, when requested to
        remove object that isn't in tree)
Date: Tue, 7 Oct 2008 20:33:57 +0200

 --CpYjv1NmbuaesVen
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Tue, Oct 07, 2008 at 02:13:58PM -0400, Christos Zoulas wrote:
 > On Oct 7, 11:50am, cube%cubidou.net@localhost (Quentin Garnier) wrote:
 > -- Subject: Re: lib/39684 (RB_REMOVE trashes link to tree, when requested=
  to=20
 >=20
 > |  You know, the fact that you're the one letting your code logic do
 > |  something that it should not do puts you in a very bad position to make
 > |  such comments.  If code of yours runs into any of the devices you list,
 > |  could you tell us brands and exact models?  I feel kind of worried.
 >=20
 > Well, this is really not productive. I think that the submitter here
 > has a point. The manual page states:
 >=20
 >      Accordingly, RB_REMOVE() and SPLAY_REMOVE() return the pointer to the
 >      removed element, otherwise they return NULL to indicate an error.
 >=20
 > Looking at the red-black code this is a lie. It never returns NULL and it
 > should really either:
 >      1. not trash the tree or
 >      2. at least document that it will trash the tree
 
 I don't see how the submitter's use of the function is different from,
 say, doing strlen(NULL).  And would you really think there is a need to
 mention that you shouldn't do strlen(NULL) in strlen(3)?
 
 If so you have a huge documentation task ahead of you.
 
 --=20
 Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
 "See the look on my face from staying too long in one place
 [...] every time the morning breaks I know I'm closer to falling"
 KT Tunstall, Saving My Face, Drastic Fantastic, 2007.
 
 --CpYjv1NmbuaesVen
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (NetBSD)
 
 iQEcBAEBAgAGBQJI66uUAAoJENgoQloHrPnokIIH/R5eVthsHDm3fhnXYw4LGo1N
 LJxp397lLqETYOylqz1P8WPPOjIFM7zXP1bWvBiGFnyq9T7CN2TDX8QpoxfKpIrF
 Ydr8RVHpfX0HpzPRg9LHk1meaqfNCbrU0s/eAheAdjDR6xsT5EBDzWYLx809KHeK
 s07GzzvgMjZA0265G5mZwy5XHYa8bylI8ZhnyeFK11kMlpZNFhgDILpckAzWN/eM
 JExyfAJ3hC9vDkU0G6LdF7hz2qFDNOXXAnnlcOn/mAvkcVrQclgBblah9hMlDUGN
 rJG0fFZ61HfTzQQJPJUxI5sm0X8G7z0kXo1aRjonEW7drYLxpnqnmeOplfta4H0=
 =rLmp
 -----END PGP SIGNATURE-----
 
 --CpYjv1NmbuaesVen--
 


Home | Main Index | Thread Index | Old Index