Subject: kern/11117: TAILQ_FOREACH_REVERSE can't work
To: None <gnats-bugs@gnats.netbsd.org>
From: Love <lha@stacken.kth.se>
List: netbsd-bugs
Date: 10/02/2000 14:30:21
>Number:         11117
>Category:       kern
>Synopsis:       TAILQ_FOREACH_REVERSE can't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 02 14:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Love
>Release:        current
>Organization:
	Stacken Computer Club, KTH, Sweden
>Environment:

System: NetBSD nutcracker.s3.kth.se 1.5F NetBSD 1.5F (NUTCRACKER-$Revision: 1.369 $) #12: Mon Sep 25 01:51:54 CEST 2000 lha@nutcracker.s3.kth.se:/usr/src/sys/arch/i386/compile/NUTCRACKER i386

>Description:
	TAILQ_FOREACH_REVERSE don't work, missing a ; and a )
>How-To-Repeat:
	try to use it
>Fix:

This at least make it compile.

Index: queue.h
===================================================================
RCS file: /pub/NetBSD-CVS/syssrc/sys/sys/queue.h,v
retrieving revision 1.24
diff -w -u -r1.24 queue.h
--- queue.h     2000/07/26 12:19:40     1.24
+++ queue.h     2000/10/02 21:23:14
@@ -355,9 +355,9 @@
                (var) = ((var)->field.tqe_next))
 
 #define TAILQ_FOREACH_REVERSE(var, head, headname, field)              \
-       for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last))     \
+       for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
                (var);                                                  \
-               (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))
+               (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
 
 /*
  * Circular queue definitions.
>Release-Note:
>Audit-Trail:
>Unformatted: