Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 18 Aug 2002 15:24:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 18 Aug 2002 15:24:04 -0400 Received: from pD9E23924.dip.t-dialin.net ([217.226.57.36]:27267 "EHLO hawkeye.luckynet.adm") by vger.kernel.org with ESMTP id ; Sun, 18 Aug 2002 15:24:03 -0400 Date: Sun, 18 Aug 2002 13:28:00 -0600 (MDT) From: Thunder from the hill X-X-Sender: thunder@hawkeye.luckynet.adm To: Daniel Phillips cc: linux-kernel@vger.kernel.org Subject: Re: Generic list push/pop In-Reply-To: Message-ID: X-Location: Dorndorf; Germany MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 883 Lines: 33 Hi, On Sun, 18 Aug 2002, Daniel Phillips wrote: > #define push_list(_LIST_, _NODE_) \ > _NODE_->next = _LIST_; \ > _LIST_ =_NODE_; > > #define pop_list(_LIST_) ({ \ > typeof(_LIST_) _NODE_ = _LIST_; \ > _LIST_ = _LIST_->next; \ > _NODE_; }) How do we protect against: push_list(getFuckingList(), node); node_t node = pop_list(getFuckingList()); ? Couldn't this break the _LIST_ = _LIST_->next; ? JAQ... Thunder -- --./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .- --/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..- .- -/---/--/---/.-./.-./---/.--/.-.-.- --./.-/-.../.-./.././.-../.-.-.- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/