From patchwork Fri Oct 13 08:45:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13420435 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 A4802CDB482 for ; Fri, 13 Oct 2023 08:48:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrDpM-0007EN-9f; Fri, 13 Oct 2023 04:47:24 -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 1qrDpH-0007Ba-Sb for qemu-devel@nongnu.org; Fri, 13 Oct 2023 04:47:19 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrDpC-0000ic-Cj for qemu-devel@nongnu.org; Fri, 13 Oct 2023 04:47:19 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-406609df1a6so19612375e9.3 for ; Fri, 13 Oct 2023 01:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697186832; x=1697791632; 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=EXTiKlfvO+fuulfbFmz2mZPBH+WQvNLbmxQB72UEXVw=; b=j8iQ4z26e9LHG8fKCqqnIhZa5dAlIjIZcDN5K4QB/BN7OTK28S7pQu69qqI30x44zi ZXMIpjc+UM7xIblrA5/hBMvuWeL8a5iLAI9EQ1lkVkPWVjIDA4c9L+b6xoB4n9hfwy08 PUD89Mlj4l/pODIeNXrru649+KQ4nlqnF4s9dMmztXr+7iLwuavc5QMmxNpyyB4Iy/PK 4aYRC8+Uy57M5te1pfRi7PKzoekekQTG3SM4xGG3sR79ct4bhx5mZauGYUfHBsqSvr4I uB7GFsHG/ZWUrHePLVjmpt6jbxilY3xU640UYwVvpqA5hVpElr9nedYOTMoOxMT5sE8X 0lVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697186832; x=1697791632; 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=EXTiKlfvO+fuulfbFmz2mZPBH+WQvNLbmxQB72UEXVw=; b=WFgp5wd+PyE4vgQybJKRLMxF6KA8u6QGoupmthBAX+Wdfz6O7L9ec2sqth7o3uRThn S83O3Nlfv1T7c1OnPsnKe5Oa0gOsQaEVcWhY4PNtCosL28zs/wzjJngW0YUp5mpY77Vv Hdb5rEx+hhZQ34JhYg8ICtxUhcgjpiI7FATfTDzyE7UdbgzrkA9JhCxZ6+U1Auz4udJC medk/w+Nq+a6drxl36E8z4Xsb9Llot/vTUJnH5nTNkwPmVk8vTAKdAPNPW2n5UyHF4Cn Ylpff4Kcx9hsTbvq4P9uzglp9W8ixNtb69D8qk4bguPECcOOMaVqqmDSuvftX2OV/RiM j8Dw== X-Gm-Message-State: AOJu0Yww9nVzaKO64ilt0v79y8s8fqyGW5JmeTt/K1pUtp1IjlG6FIca Sfj0o9JHE1EYGahn4ZGHw+u+3rXZ9ZMxI3AiRQ8= X-Google-Smtp-Source: AGHT+IFmROStdTDzvesvS9nbrDcS0C5fYKmbGdy4ZcM5cRYyP1xv3WjNBkO16s435OkWuYeyix/lfg== X-Received: by 2002:a1c:f710:0:b0:404:746e:c601 with SMTP id v16-20020a1cf710000000b00404746ec601mr21467492wmh.9.1697186832102; Fri, 13 Oct 2023 01:47:12 -0700 (PDT) Received: from localhost.localdomain (adsl-170.109.242.226.tellas.gr. [109.242.226.170]) by smtp.gmail.com with ESMTPSA id v10-20020a5d678a000000b0032d9f32b96csm569185wru.62.2023.10.13.01.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:47:11 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org Cc: Emmanouil Pitsidianakis Subject: [RFC PATCH v3 00/78] Strict disable implicit fallthrough Date: Fri, 13 Oct 2023 11:45:28 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wm1-x329.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=ham 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 -- Resending because --function-context was accidentally used in the previous version. Sincere apologies for the noise. --- 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