From patchwork Fri Oct 13 07:56:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13420291 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 02B6DCDB482 for ; Fri, 13 Oct 2023 08:05:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrD3Z-0005l3-NU; Fri, 13 Oct 2023 03:58:01 -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 1qrD3V-0005SM-1b for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:57:58 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrD3R-0006gR-65 for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:57:56 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32003aae100so1941064f8f.0 for ; Fri, 13 Oct 2023 00:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697183871; x=1697788671; 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=GWEDDjpnotGgfjBWIGymqSBCTGiIkdJBZqbb3fHuwY0=; b=r83Armhj/Pfnxmg4JiURmW1kI9rL8nz71vWeq70IeDbpaeoJnXE5SVAnJW4yMPZwKe 6LnrTUEgJVGscddptvyOG6ye7d6kPMCBYmTYI/ydnK2E7X5KJhsaOJB0w0BzG4iRihuO SJeXknyBcIULWAcX+5R3fJXB2IUb6Lo07lARJZx16KNYtPiQHzUMtR7KHN9jlZZ/e3MS b5Ax63gvlOlgBwI57HYEcc3YOFfPQacRCAMGEmf8e2kv8fOVDvz1LuC0z/7KRhIC/Efl cC75piAu/Rb+K0mc+QsVPdRQy6DlitEg0dKLqweqVQqxHpvA80mtOIdhPdBOCeVcx8wF cVDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183871; x=1697788671; 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=GWEDDjpnotGgfjBWIGymqSBCTGiIkdJBZqbb3fHuwY0=; b=aC/1bMwmFehZrJ6t6lUpNOZ54JuL7xakTzgS5pSZRQMCIUBfKwMrM7yOkoyZEgQI8W gU4X55nLOJ/DAon5aAgQ8H0ZrfHJVGYz2Y14WGjGJVzr4Uq0RK614xzXAdwqhXOP6zZT /78P86JNgQIbaWwTpxFQa4QA32HkTOVNc1fHGYcvLrhqD2RxtdwfTJxA7ltQ7BoeaNce 1JhA3LW/JOjHsiKdPVGTuqa3zpdtpRd3BTn9F8g4VLKSe6j6CoFYEyxhL/aazXzE/I9Z 6/fS3tW7beswRGA6bQKgWhjagC0bkHbgasbVtA9BljdoiBhehHLO2qOJwHWS/f0OaQdL 4eaA== X-Gm-Message-State: AOJu0YzXFAieHnLoZrlgU94IaJBA7/iQbkylOlGxTK45/68kbcb4i7PS k2cFlzipALsSETk6Rjp4S9yhzK0MmW9c2KluJDI= X-Google-Smtp-Source: AGHT+IHJhu7Z+eZgDXz1TG0wi2rK1uEEenf24D0Sl+HXaYnwmS6X9cmkVilwuzEVlBtYQXVQB0EU2A== X-Received: by 2002:a05:6000:1c6:b0:320:67:1887 with SMTP id t6-20020a05600001c600b0032000671887mr19228401wrx.28.1697183871002; Fri, 13 Oct 2023 00:57:51 -0700 (PDT) Received: from localhost.localdomain (adsl-26.37.6.0.tellas.gr. [37.6.0.26]) by smtp.gmail.com with ESMTPSA id a10-20020a05600c224a00b003fe23b10fdfsm1798183wmm.36.2023.10.13.00.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:57:50 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org Cc: Emmanouil Pitsidianakis Subject: [RFC PATCH v2 00/78] Strict disable implicit fallthrough Date: Fri, 13 Oct 2023 10:56:27 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x42b.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 /* resubmitted because git-send-email crashed with previous attempt */ 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