From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169Ab1AYJkd (ORCPT ); Tue, 25 Jan 2011 04:40:33 -0500 Received: from cantor.suse.de ([195.135.220.2]:33611 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752419Ab1AYJkc (ORCPT ); Tue, 25 Jan 2011 04:40:32 -0500 Date: Tue, 25 Jan 2011 10:40:30 +0100 Message-ID: From: Takashi Iwai To: Jiri Slaby Cc: Andreas Mohr , jirislaby@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Andy Whitcroft Subject: Re: [PATCH] azt3328: repair breakage (Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro) In-Reply-To: <4D3E888D.60909@suse.cz> References: <1295704570-27015-1-git-send-email-jslaby@suse.cz> <20110125054631.GA10984@rhlx01.hs-esslingen.de> <4D3E888D.60909@suse.cz> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Tue, 25 Jan 2011 09:23:41 +0100, Jiri Slaby wrote: > > On 01/25/2011 06:46 AM, Andreas Mohr wrote: > > It is also quite interesting to note that this rather uncommon language syntax > > (do...while(0) within switch scope) compiled cleanly without issue > > (no warnings). > > Note that the switch block is the same like the others and case and > default and very similar to goto labels. You can even do: > switch (x) { > int abc; > { case 5: abc = 7; break; } > do { case 3: abc = 5; break; } while (0); > while (1) { > printf("%d\n", abc); > default: > abc = 1; > } > } > And check what it will do for x == 3, 5, and others :). Oh, don't let him bring to the dark side of C again :) Takashi