Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 5 Apr 2001 10:46:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 5 Apr 2001 10:46:40 -0400 Received: from ns.suse.de ([213.95.15.193]:34571 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Thu, 5 Apr 2001 10:46:27 -0400 To: Joseph Carter Cc: Bart Trojanowski , "'linux-kernel@vger.kernel.org'" Subject: Re: asm/unistd.h In-Reply-To: <20010405072628.C22001@debian.org> X-Yow: I want another RE-WRITE on my CAESAR SALAD!! From: Andreas Schwab Date: 05 Apr 2001 16:45:44 +0200 In-Reply-To: <20010405072628.C22001@debian.org> Message-ID: Lines: 29 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.101 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Joseph Carter writes: |> On Thu, Apr 05, 2001 at 09:06:20AM -0400, Bart Trojanowski wrote: |> > So you ask: "why not just use a { ... } to define a macro". I don't |> > remember the case for this but I know it's there. It has to do with a |> > complicated if/else structure where a simple {} breaks. |> |> This doesn't follow in my mind. I can't think of a case where a { ... } |> would fail, but a do { ... } while (0) would succeed. The former would |> also save a few keystrokes. Try this and watch your compiler complaining: #define foo() { } #define bar() do { } while (0) void mumble () { if (1) foo(); else bar(); if (2) bar(); else foo(); } Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz?ckerstr. 10, D-90443 N?rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 - 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/