Date: Wed, 02 Jan 2002 17:44:40 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Garance A Drosihn <drosih@rpi.edu> Cc: Stephen McKay <mckay@thehub.com.au>, Julian Elischer <julian@elischer.org>, John Baldwin <jhb@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Julian Elischer <julian@FreeBSD.org>, Greg Lehey <grog@FreeBSD.org> Subject: Re: cvs commit: src/share/man/man3 queue.3 Message-ID: <98230.1009989880@critter.freebsd.dk> In-Reply-To: Your message of "Wed, 02 Jan 2002 10:52:44 EST." <p05101000b858dc1a097e@[128.113.24.47]>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <p05101000b858dc1a097e@[128.113.24.47]>, Garance A Drosihn writes: >>The man page should explicitly state that p is undefined after the loop >>completes unless the user breaks out. Oh, and explicitly stating that >>it is OK to break out at all might be nice too. :-) Agree and agree. >Perhaps I am missing something, but this issue seems pretty simple to >me. What's wrong with: > > keyp = NULL; > TAILQ_FOREACH(p, &list, p_next) { > if (some_test_on(p)) { > keyp = p; > break; /* optional */ > } > } > >and then using 'keyp' outside the loop? Again: agree. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98230.1009989880>