On Mon, Mar 05, 2012 at 11:34:43PM -0300, Christiano F. Haesbaert wrote:
> On Fri, Mar 02, 2012 at 12:46:15AM -0500, Lawrence Teo wrote:
> > The following example code in the queue(3) man page to delete all
> > elements in a tail queue generates a warning in gcc and clang.
> >
> > while (np =
On Fri, Mar 02, 2012 at 12:46:15AM -0500, Lawrence Teo wrote:
> The following example code in the queue(3) man page to delete all
> elements in a tail queue generates a warning in gcc and clang.
>
> while (np = TAILQ_FIRST(&head)) {
> TAILQ_REMOVE(&head, np, entries);
>
The following example code in the queue(3) man page to delete all
elements in a tail queue generates a warning in gcc and clang.
while (np = TAILQ_FIRST(&head)) {
TAILQ_REMOVE(&head, np, entries);
free(np);
}
Here's a "demo":
===BEGIN===
$ cat tail