Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2261942pxb; Sat, 19 Feb 2022 06:37:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaHEdyGHXOM1fDOizHcc7dSi5iDfroqyDbv6pQEhfhySv4RJH8es6NATg8getem9LeRfHl X-Received: by 2002:a63:9149:0:b0:372:8bfe:6b03 with SMTP id l70-20020a639149000000b003728bfe6b03mr10123696pge.43.1645281428497; Sat, 19 Feb 2022 06:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645281428; cv=none; d=google.com; s=arc-20160816; b=n8AyqxEcWRDsXN9mSHa0EY0k9hvinMLqdCv6rOvKNDhNnKrOmuPAioPm52ZaSlYI6E eW8bLk3sHWmUDMRs0K2a494idMpb45lhjfu/cmMsdTmN4lHIC/pWsm/yWlLbtB8S3ET6 44gTKPKZl3lXCb9dGfljjebiW1686g7tApVM9llTqoGXxi5vyzAGtcx76znxp37nSw52 rrMHPneb6GrhPii+hNbNbIJTAxOVHIvlKBXcObmDIi9U+8zCZWJQ6q/k2kDcpd7LjnXu HHK7EQ2adsljllL1PkEanP000jNZzMZXtJQ12TJa/aR7wg2yZ9eaKqFTRhfyBLJ+KKv9 H5aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=c2GW4DbzAfWGfBPzLl65EVopMl3FQwhCddZ7v7eEWfs=; b=ub5wpoOpsBl3IEjJ49MGEIFPep5KjlLIBAJjzKSrZF+pzjFB8O032Idnnzn1CElN16 1SoL/qRC9JRGtHT/tZTtiwwktcuks2KDWtRGqpCe6gTOJFnnst3m7vrUjlcKIV3KDbPb Kn01DZrzV0av8ZpNMrk3vrsgKpz5g00IFTlUPZWtgkDLx9UM2u60Dfy6opvilw1tYQqQ tnIdcmdwSAKOx2fvBp63uD7ON/CJaV+WZn130wUsif8v//WtYcQVTr3Ro1KIgDvIpM0H e9zKdbHTOmlUvUtM456MqmtZxhYsxvow+3c/GHpwPmjjlSgPFPOCTRvyHryo1LpTaMAG 8UvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=stM3YoCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u185si4723735pfc.86.2022.02.19.06.36.51; Sat, 19 Feb 2022 06:37:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=stM3YoCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235742AbiBRXHw (ORCPT + 99 others); Fri, 18 Feb 2022 18:07:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235363AbiBRXHw (ORCPT ); Fri, 18 Feb 2022 18:07:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 442F95AECF for ; Fri, 18 Feb 2022 15:07:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF533B82677 for ; Fri, 18 Feb 2022 23:07:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 581CAC340E9; Fri, 18 Feb 2022 23:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645225651; bh=5tvre9+be3n04DFPNwxXq80/EJVN+yhMVA7ExsDuacM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=stM3YoCUjzizuAYk82bXE1DW1eS1OGoKRAldTUJFE3jhePXwAr3h4tXU6xs2tfl9a ebAMlveHnHvQAeut1TlwmpOWFssEdnJJ4Sqiw6/joWI9ecYg8GXNZwz1tBINwdT3xd fVpChmRCPkcXnXtzPL79UfEQGZciUvq5EeCopiNI1qgyFRnPxm6azI/mUB6VNcsIta WQhmgpIQdA/VQp3V5wIzUB/yuVu5pIZJLp79WA45REy6gywLgi9bRHnKgKlN78nua7 V82VLdcFfHCsPuDFdLp18kCNXSWn6q9eVivpdDeJ3P+czJGFwfQdb93l2GvuWycCUu vNWpwb79vu6Xw== Date: Fri, 18 Feb 2022 17:15:16 -0600 From: "Gustavo A. R. Silva" To: Randy Dunlap Cc: "linux-kernel@vger.kernel.org" Subject: Re: fallthrough question Message-ID: <20220218231516.GA1091555@embeddedor> References: <858a2b13-64e1-99bc-e2f7-5b2477bb1126@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <858a2b13-64e1-99bc-e2f7-5b2477bb1126@infradead.org> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi there, On Fri, Feb 18, 2022 at 01:57:58PM -0800, Randy Dunlap wrote: > Hi, > > I expected this to produce a fallthrough warning, but it doesn't > (with gcc 11.1.0): > > from sound/oss/dmasound/dmasound_core.c:#1481, when falling from case 1 > into case 0: (in arch/m68k/ selected builds only) > > case 1: > if ((size = ints[2]) < 256) /* check for small buffer specs */ > size <<= 10 ; > if (size < MIN_BUFSIZE || size > MAX_BUFSIZE) > printk("dmasound_setup: invalid write buffer size, using default = %d\n", writeBufSize); > else > writeBufSize = size; > case 0: > break; > default: > > Can you tell me what is going on here? As you can see the warning is suppressed when a case label falls through to a case that merely breaks... or returns, or continues (continue statement) or that goes to (goto statement) some other place. However, Clang disagrees with this. See below for more: https://github.com/ClangBuiltLinux/linux/issues/636 https://godbolt.org/z/xgkvIh -- Gustavo