From patchwork Fri Oct 13 07:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13420235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F9A8C41513 for ; Fri, 13 Oct 2023 07:50:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrCvR-000490-SM; Fri, 13 Oct 2023 03:49:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrCvP-000485-RP for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:49:35 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrCvL-00042B-AF for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:49:35 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40684f53d11so21738875e9.1 for ; Fri, 13 Oct 2023 00:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697183369; x=1697788169; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZMWm7PYeA94VivoVKWT0oooHMlaYiSocgiFxO0wxv54=; b=QkyAmzX8vNZygBKWvmRBpVmPwlIYbsvd/9h69hBNyDkqTtUBc4GupHlATyf6LD/Etn Ati9tODuC2oOuGlcAKPZ3WyhJr98uaF/0OubMl/7Qc/Z4ZI3Qz7uVjbGuRhnYr5WBepn 04HXbO04Z7CEwFrDlGTClpPzIlnmPSeNm6TKKsr8eFSim9zp4gwevxK4lCi9568rCoAJ 6PnaKkn9cM4ZFyqIX8uQD+ANJkCboME5iEBY5hDfwz7QYxOWukOaxtGn264J7fFzDwuL /Nyk9jUCDPI3OOYbEE9rPcv/jPk+8oLye5JwqVd8Mi+elBuw4g0yFfHQlRes5NGaorXl 865Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183369; x=1697788169; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZMWm7PYeA94VivoVKWT0oooHMlaYiSocgiFxO0wxv54=; b=QZaMODmS1dDA8qUw0+bXx3pUcBYH0hVkUI1aAw11CqrUBux8+Z/HtAvVBYzwIldVCv lnrHuD4vg0bCGx+ZWbkbjJ6cuy4DP4pTlrUdnjlh4EovPWvkLhBqvAVd7tFukI9+wWHB 4QPETQctH/Sjsusr22lFN5nuKg2ue0HP+erH5MVzSyYxJl0TuIX/t7uN2MED6zBu22xi tKCjoxhXet4P/elh+gbobbq+STgx8GPkelvLaZbJ4R4A+236eG/4HVmx38+OS+gYf7DM VTA7/kWhvj6pcgqjFQncS2FQag3MANXzpwG4Km5t636FCfdHF9xCKbdBtMW+ZcjctBM0 TztA== X-Gm-Message-State: AOJu0Yw71+L6l1jf1Do/jUHuUv0xVcQ4DQirMy7Ig4zQPQTLD/s+t9Qv IKbIa2d9BMNk5TM6ZVrJBFjEY7Xskr3doBI4pfk= X-Google-Smtp-Source: AGHT+IGPXmvW2vcgpuyx9drM1CgZai3elZ93YkLA7EqK0I5zD7ZbvlKCdl36MZMAIfV9Vie9Zm2oAQ== X-Received: by 2002:a5d:4fcf:0:b0:31f:f99c:6013 with SMTP id h15-20020a5d4fcf000000b0031ff99c6013mr20885228wrw.61.1697183369326; Fri, 13 Oct 2023 00:49:29 -0700 (PDT) Received: from localhost.localdomain (adsl-170.109.242.226.tellas.gr. [109.242.226.170]) by smtp.gmail.com with ESMTPSA id m8-20020adfa3c8000000b0032d7fde2d3csm7990663wrb.79.2023.10.13.00.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:49:28 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org Cc: Emmanouil Pitsidianakis Subject: [RFC PATCH 00/78] Strict disable implicit fallthrough Date: Fri, 13 Oct 2023 10:47:04 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hello, This RFC is inspired by the kernel's move to -Wimplicit-fallthrough=3 back in 2019.[0] We take one step (or two) further by increasing it to 5 which rejects fall through comments and requires an attribute statement. [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a035d552a93b The line differences are not many, but they spread all over different subsystems, architectures and devices. An attempt has been made to split them in cohesive patches to aid post-RFC review. Part of the RFC is to determine whether these patch divisions needs improvement. Main questions this RFC poses ============================= - Is this change desirable and net-positive. - Should the `fallthrough;` pseudo-keyword be defined like in the Linux kernel, or use glib's G_GNUC_FALLTHROUGH, or keep the already existing QEMU_FALLTHROUGH macro. - Should fallthrough comments be removed if they do not include extra information. Some external resources ======================= See the RFC discussion in the kernel: https://lore.kernel.org/lkml/1d2830aadbe9d8151728a7df5b88528fc72a0095.1564549413.git.joe@perches.com/ The `fallthrough;` pseudo-keyword in the kernel source code: https://elixir.bootlin.com/linux/latest/C/ident/fallthrough In summary, I quote the doc comment and definition: /* * Add the pseudo keyword 'fallthrough' so case statement blocks * must end with any of these keywords: * break; * fallthrough; * continue; * goto