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 <>
To: Christos Zoulas <>
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

 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, (Quentin Garnier) wrote:
 > -- Subject: Re: lib/39684 (RB_REMOVE trashes link to tree, when requested=
 > |  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.
 > Well, this is really not productive. I think that the submitter here
 > has a point. The manual page states:
 >      Accordingly, RB_REMOVE() and SPLAY_REMOVE() return the pointer to the
 >      removed element, otherwise they return NULL to indicate an error.
 > 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.
 Quentin Garnier - -
 "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.
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 Version: GnuPG v1.4.9 (NetBSD)

Home | Main Index | Thread Index | Old Index