Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1908944ybh; Sun, 4 Aug 2019 12:41:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5NH1p28YdDxPCZh1WahhUs8BsLNboBnvYeJ6JyRCiOLkrFptPczQBLkLygqoc78cUhrLb X-Received: by 2002:a17:90a:d997:: with SMTP id d23mr14077570pjv.84.1564947689655; Sun, 04 Aug 2019 12:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564947689; cv=none; d=google.com; s=arc-20160816; b=Da+eDy66oHFJVLV/4EguhTwg8Eh2vlI+zMRJgcMdRqDhYl5AzePGSrqQVSPknnm/ga kzFuhxFh0DDT9m9EU5PrqUpVIrnXzPkJO/8nPqjQnHHyfbSQZWZ7qGjg0AVaCCys4lGj R8KxyUdxSZe/FB6D9W1xHtbim4QZOSfGgEB6YuW1T86EXnp5vMpogb/CzUQBcVP6Fa8r 2lMyVCrwtkiuP7mMlYwuWsLZghJvzjufcCKOVwfnEBKNj8nlHgN4tbwclZ+4PnwOiJdJ gg1O5cHP5pX5sWK9SM+HBRlQSwdTsC0kCY3DczabIC6LR9LF6DrDxEDBcILxi+Ynsy1z eb9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1FFHYtKFMV/2rUVBEWqxxlBuT8jt7JwtVpdGxJtcgL0=; b=Q0w5FwkVqbZE01TB2lmj0S5SWFATh6gDLtQgedvtNa+Yh1ZUVuZ6K9DnwxMmV2OEy4 2uHZn3z+Vvph4rmvDoiUCjUzZZJXfQ27LHfZ6/ueXPcS9uzf6Ad3GgLHrTTEPv/Xx5vt S/EJfp7kSkuZ+9dNBPe8eeIA0DxGp2FcmsCc4sDSARixxYcNCrQZOwEkYSVfhWtAWoKu dBlKCfcrlPqRr5w8978AaCKNiejSL7n1TDlntOPVhIodjt/aDutqmcPb1aq7peN9d5P+ gRUaH/obFSqfgRwUFPUhjw4eOGFg0HMxsvGsJyNjLp022dXjHkVEE0IUeM9tiOksishs zaqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KwAep6Ug; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si11325947pjb.30.2019.08.04.12.41.14; Sun, 04 Aug 2019 12:41:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KwAep6Ug; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726712AbfHDTiN (ORCPT + 99 others); Sun, 4 Aug 2019 15:38:13 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39093 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbfHDTiN (ORCPT ); Sun, 4 Aug 2019 15:38:13 -0400 Received: by mail-lj1-f196.google.com with SMTP id v18so77328054ljh.6 for ; Sun, 04 Aug 2019 12:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1FFHYtKFMV/2rUVBEWqxxlBuT8jt7JwtVpdGxJtcgL0=; b=KwAep6UgDtrWClq1iSze66fD1WTuPx7njizz33IgGpTcps71ljHk13Az4yKAN49n/n mco7jTJfboxs3ck3xyaHfWT3TmkNMx13/W8BVaQPJZtfhIqHRxxBp1XIA15swvRs6yqw KSFZFOlCPRaE++pDwNCC/H62dZ7sOsmCJBfzvUFLi5DpD8igKAR4iMLSSMAKannTHM8k rM4TzAw8lAPt3TRDxv7vOYcmYOMCpU1MvQeJTpiux6e/A3PFR3ExVoFkhRTuxiJN0hy4 iVJnDrHZqv0/JlHafd1RSXkQJbJrnOg09+jHRuJ2hcD4DqRrGwB5FORANLJ7PcgbU/AQ P+0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1FFHYtKFMV/2rUVBEWqxxlBuT8jt7JwtVpdGxJtcgL0=; b=IGmEog2nOjr0V7VUfLt9l42zAoJ/c0knPhTAeV4Yn0DKpY5ubcOsok91K9EQBoL28n V6yO/lNHbTfU1QAdxEPrbuVQHkZFF0N7YgSBf2dm9FJfgLryGeqwMsbIHBCBozbvK5xS 6PGwE6lV2blhGvv2RuuYoyI4B3QyTew9+fBcFaOBil1vK06CkgJUrfmg7CoLiCOcHFHo ixYNm0pFI02hcEE/V69D9Xq0R3ZGLDVpNUzI1457p3Tggn5KpLO6Swzkxa5BKqZV1Nrh IKpvtJYTFsdE3w8JVzuq5HB0OskJXjghJVW27fBRKGp+9vbXmfPdY636cy1c58kYoLNo kSPA== X-Gm-Message-State: APjAAAVCoCuK5k02fDL3c2jBC1dhp4TnP+BEtOw/LgRGZgLcOpYd/+1O UqIkBWhNnHxdfP842hU+1lx+9KtHFXiZ7RF1fho= X-Received: by 2002:a2e:8849:: with SMTP id z9mr37043598ljj.203.1564947491487; Sun, 04 Aug 2019 12:38:11 -0700 (PDT) MIME-Version: 1.0 References: <1d2830aadbe9d8151728a7df5b88528fc72a0095.1564549413.git.joe@perches.com> In-Reply-To: From: Miguel Ojeda Date: Sun, 4 Aug 2019 21:38:00 +0200 Message-ID: Subject: Re: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use To: Linus Torvalds Cc: Joe Perches , Kees Cook , Peter Zijlstra , Borislav Petkov , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Pavel Machek , "Gustavo A . R . Silva" , Arnaldo Carvalho de Melo , Kan Liang , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Shawn Landden , "the arch/x86 maintainers" , Linux List Kernel Mailing , Neil Horman , David Miller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 4, 2019 at 8:09 PM Linus Torvalds wrote: > > So my only real concern is that the comment approach has always been > the really traditional one, going back all the way to 'lint' days. > > And you obviously cannot use a #define to create a comment, so this > whole keyword model will never be able to do that. > > At the same time, all the modern tools we care about do seem to be > happy with it, either through the gcc attribute, the clang > [[clang:fallthrough]] or the (eventual) standard C [[fallthrough]] > model. Quick note regarding C2x: fallthrough didn't make it yet into the draft (other attributes already did), but it may still be added. > So I'm ok with just saying "the comment model may be traditional, but > it's not very good". > > I didn't look at all the patches, but the one I *did* see had a few issues: > > - it didn't seem to handle clang Hmm... Not sure what this refers to, but note that Clang will likely get support in the next release (they are working on it at the moment). As far as I understand, we do not yet establish a minimum version for Clang since they still solving several issues, no? > - we'd need to make -Wimplicit-fallthrough be dependent on the > compiler actually supporting the attribute, not just on supporting the > flag. If the above is correct (i.e. if we do not care about a specific version of Clang just yet), and since gcc got support for the warning at the same time as the attribute (7.1), I think we don't need to do special handing for the warning; but if someone knows about a case where we do have an issue with it either with GCC or Clang, please let me know. > without those changes, nobody can actually start doing any > conversions. But I assume such patches exist somewhere, and I've just > missed them. I think the primary concern has always been the tooling (e.g. Coverity was mentioned in October and also this time, and well as some IDEs/text editors), not the compilers themselves. Cheers, Miguel