Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28288566rwd; Tue, 4 Jul 2023 16:58:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlE6kvZYHYI6yOwGgGVP1Ak7DnzRm/VaVuvnESSGsEPeMyW2eQRAVuQQjIf38VmXr18DAbtj X-Received: by 2002:a05:6a20:9190:b0:12c:a8e9:7bf6 with SMTP id v16-20020a056a20919000b0012ca8e97bf6mr747327pzd.10.1688515118506; Tue, 04 Jul 2023 16:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688515118; cv=none; d=google.com; s=arc-20160816; b=fankbOrVGqapZ6/EThrJZ30gOFBgCw3j5Wc696N8wqfgEFFA8gYnBwmgzVXMk+WlRb kTjtwhmSTvmGOTTWOKSLPVVo4TkTpXxdESn1omWglnLLEa2EXrrgd9OB2H1K9H0KGoeV nyqeWkdpDb0LrMo/Dm8ejSjjG5r8awIQGTdoY+pcQRWVjrudTp0d+GZABdHtEfPRJq4b lesLCFN8DQ8hjw3wjfQjkJMsxgYVhDVw6nd87VIZHuXLyNT8QfgHtbOtU8UtWOmeQ0/W zCcMbULzW5sHjrjUMsYyflCKirAlZLpmynl+eMhvlkUYds9vJ/oV8+VmfVEu5DFbaxyE TW3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=DYR9hAz3rDQalm/RdUseeoijBoiPmBCuez9RUze2Jmk=; fh=2iF770j4E+xLX6sSbRlnxR3+f8NbGJEvtMMrNKamqws=; b=TuI1RgwZkaqCDd68CABfh2X9bIYAaCa1vumZek1SIHNsrxpFtVAlHgXGim4XNb5qKT JOGuwhXJWdNAXogdTamgJQaLI5kbpJutQm7k4TdI422FobDxpmwRw6u4yXD5g3rcWyz1 dpIhsqwEGoiRI5v3WIgSCQ5gBQNa3ob+enYpH96hvWJFF7JZCuon8qSjpbm01P/QHtE/ 1n8bAGVSpm6j4OPc6cns6yYUtE7oxytVmnyJT5Yi63h0cAzh0ebhL+kwE3nFh3ppj66K EIh8FtNRnni/XLuSoTRVvuNRin2aKjOrNq0y6e6H59funUEEEHN/9eO/EqrqRoYJqjSJ kpnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=AewNkijx; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=dSJxX6hP; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c75-20020a621c4e000000b00682642ec7c0si9919738pfc.338.2023.07.04.16.58.25; Tue, 04 Jul 2023 16:58:38 -0700 (PDT) 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=@alien8.de header.s=dkim header.b=AewNkijx; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=dSJxX6hP; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231455AbjGDWU1 (ORCPT + 99 others); Tue, 4 Jul 2023 18:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbjGDWUW (ORCPT ); Tue, 4 Jul 2023 18:20:22 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BF38E7B; Tue, 4 Jul 2023 15:20:21 -0700 (PDT) Received: from mail.alien8.de (mail.alien8.de [IPv6:2a01:4f9:3051:3f93::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 170DB1EC0411; Wed, 5 Jul 2023 00:20:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1688509220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=DYR9hAz3rDQalm/RdUseeoijBoiPmBCuez9RUze2Jmk=; b=AewNkijxRaoyWaJPvJF6Ea7RnZQQJR6BRKs3onT1XCjy1rT3+X1c1ALSb9wr7uBOsqVMO6 2naHj7OP/QR6suQkt2yzk5/722T6s+7Rdvk+AETUoUfMGXOhWgcV5KbO7zVOYsfPZBXZZr GzN2e3PlVoObTOEUUGyhNODLkQdE8lI= X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yi7bw3IKtw5u; Tue, 4 Jul 2023 22:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1688509216; bh=jL6uSfBqNDPocAax2P6VBh9QZjlwPpa5/eC7tTGcSuA=; h=From:To:Cc:Subject:Date:From; b=dSJxX6hP6I0eMV+X+3UTunv3irjEQIEhRES5RMR4pbbBhhbrBznYTqc1I02a/zVNx 9cyEksmAQDLRBS1mdChoqBaQSNvINxSek6zN8n9JAKXjfD5tzU6UItPy4wf0tuW4ju npX3sUQEcTPmNG0qbLkLawVcdayzsoVV3OyC9Nf0LuKULlfS8/+acFFE8zTasvBg// YEFF3ml50yFLcNh8R2MlcowGfNtH+iUjTk5DW2HZaW67Rd38qw7jPzwY0ksZSqZL5d W/PakyDt0ZuoAvudhXtuzUCWub8voioD4P90k34h8YFWrYGb8n+1GHLVI2BUr7H4Jv dNU+uTqm5pp5EP1ARXV8h+yZGdJsL1j4qbOv8iXjuYitWbsSBo9vIdPOSADnIpwECF NQnT1ZB7JaMbn3HMFJZS3Q6EftC0e0u+fyPfBeju9NecP+iVtNWsFmy0iM0nkDm29W 1fGRcOX+CBj9sj20F+oQEtIyPlQvIV95AsynatRvjufV7HjBQ2xjwtyYJEvRegRgJV AxRF2nEAryYywo5mFZG22eAiQWXnAqt1v751rqbBG16cIJBfedhpW7H8tV7MzvPJ2g RhgYRIQ4wcIJbjhM3d0I1rGm3IEorDQCVsyui7RI4kmcrIGWbvVxJS0Glakmtyb3HQ kGyZO+UqZ1vux1osFZM41JJ8= Received: from zn.tnic (pd9530d32.dip0.t-ipconnect.de [217.83.13.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 34E0B40E0191; Tue, 4 Jul 2023 22:20:14 +0000 (UTC) From: Borislav Petkov To: linux-kbuild@vger.kernel.org Cc: LKML Subject: [PATCH] kbuild: Enable -Wenum-conversion by default Date: Wed, 5 Jul 2023 00:19:51 +0200 Message-ID: <20230704221951.7396-1-bp@alien8.de> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: "Borislav Petkov (AMD)" This diagnostic checks whether there is a type mismatch when converting enums (assign an enum of type A to an enum of type B, for example) and it caught a legit issue recently. The reason it didn't show is because that warning is enabled only with -Wextra with GCC. Clang, however, enables it by default. GCC folks were considering enabling it by default but it was too noisy back then: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D78736 Now that due to clang all those warnings have been fixed, enable it with GCC too. allmodconfig tests done with: x86, arm{,64}, powerpc{,64}, riscv crossbuilds. Signed-off-by: Borislav Petkov (AMD) --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 7a5a175f708f..428132b3d6dd 100644 --- a/Makefile +++ b/Makefile @@ -1082,6 +1082,9 @@ KBUILD_CFLAGS +=3D $(call cc-option,-Werror=3Dinc= ompatible-pointer-types) # Require designated initializers for all marked structures KBUILD_CFLAGS +=3D $(call cc-option,-Werror=3Ddesignated-init) =20 +# Warn if there is an enum types mismatch +KBUILD_CFLAGS +=3D $(call cc-option,-Wenum-conversion) + # change __FILE__ to the relative path from the srctree KBUILD_CPPFLAGS +=3D $(call cc-option,-fmacro-prefix-map=3D$(srctree)/=3D= ) =20 --=20 2.41.0