Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264202AbTFPTre (ORCPT ); Mon, 16 Jun 2003 15:47:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264208AbTFPTre (ORCPT ); Mon, 16 Jun 2003 15:47:34 -0400 Received: from co239024-a.almel1.ov.home.nl ([217.120.226.100]:28549 "EHLO localhost.localdomain") by vger.kernel.org with ESMTP id S264202AbTFPTrd (ORCPT ); Mon, 16 Jun 2003 15:47:33 -0400 Date: Mon, 16 Jun 2003 22:05:10 +0200 (CEST) From: Aschwin Marsman X-X-Sender: marsman@localhost.localdomain To: Timothy Miller cc: Linux Kernel Mailing List Subject: Re: Coding technique question In-Reply-To: <3EEE2293.6010304@techsource.com> Message-ID: 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: 943 Lines: 37 On Mon, 16 Jun 2003, Timothy Miller wrote: > I believe I've seen this sort of thing done in the kernel: > > do { > .... > code > .... > } while (0); > > > What I was wondering is how this is any different from: > > { > .... > code > .... > } See the Kernel Newbies FAQ at http://kernelnewbies.org/faq/ Q: "Why do a lot of #defines in the kernel use do { ... } while(0)? " Best regards, Aschwin Marsman -- aYniK Software Solutions all You need is Knowledge Bedrijvenpark Twente 305 NL-7602 KL Almelo - the Netherlands P.O. box 134 NL-7600 AC Almelo - the Netherlands a.marsman@aYniK.com http://www.aYniK.com - 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/