Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29290750rwd; Wed, 5 Jul 2023 09:41:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IU90Hz3cewOoKA0uAQtdF11iCl4SCbXw0NHNcFenj9+xd5s8pZxlHehrekhNoSHE9Sc87 X-Received: by 2002:a9d:740d:0:b0:6b7:5363:1eea with SMTP id n13-20020a9d740d000000b006b753631eeamr16178857otk.16.1688575284407; Wed, 05 Jul 2023 09:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688575284; cv=none; d=google.com; s=arc-20160816; b=qne1i8ZW6lyQTzNXqlvPoEub5BwDpblaM7oKx318Jg3BrqMC+X75IcaGP6t30AfZuJ leuGJG9wnHPDtiLaR5x7ueTjBSKA4fzuZfgwMM/mx0KdYIYfiigTKoapBYoAaP5zOO1T ufZp63wVwcP81x+ywdSfy5uWmGDs0y5AxXeEKHxm69MzikQNAido/SA6mY4vWew1uIyl 1HytogzZGXpvWGu2O+tq+X77gLguMw9YXtcE2pi6seSXIH85twhgNACL7qvvWuOzCjZZ RPc20Rxu3PhgEfkdVWkA3xmThaCC+FI7iZG/LXc0z380/eEv0bVKfJjdBKN1ZivYcWdZ nbTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1PSdWsuxg6jI1PEMcjbqHi+zzu7p8DPjP/YCVm6cA6w=; fh=ouAzNVhhXRF5Zxlu1pwKxhP7gP10d6Re6JPOrCA8eHU=; b=c5cuPNrgXFOxi2h1ro6r+ZkeDDRXbOq3FgJ+EmDUSyd3gqwXGaZXNgjLTJrK5Kovuh WboyftmStlGcB4Tf0j+OCp2u1h61maBEmPQW26Qzkq2teBNxLsnbU6T/JPsowuqgv11c eHqxP7NvLgt2LZ7FBN0HqY0n46D7ImuS0ecXQNwfCkgDjkev96qvTGMxnmcwFYgeJUSS XmR98gwWMw7wSp1QRxrLj72liWdGibMNnaHcMMo5KoZN1pljzaI9jyXEYQpvqrUxFS+o pIowcsngMe54LCNrkH25VPljx+pjhZBMdFGeZLjwxERVnSN/5vdcHPw/R8/TTL28TER1 TV6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNbX5gJW; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t62-20020a638141000000b005481915c0cfsi23110685pgd.1.2023.07.05.09.41.10; Wed, 05 Jul 2023 09:41:24 -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=@kernel.org header.s=k20201202 header.b=bNbX5gJW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbjGEQUb (ORCPT + 99 others); Wed, 5 Jul 2023 12:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjGEQUb (ORCPT ); Wed, 5 Jul 2023 12:20:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBE221703; Wed, 5 Jul 2023 09:20:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F414614CB; Wed, 5 Jul 2023 16:20:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A62C5C433C8; Wed, 5 Jul 2023 16:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688574028; bh=G7AHsttbExuu7iAPGPc7tUyss2l3OZIYar6Xamqq4x0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bNbX5gJWlwKzmQM0I/oXUZ+R7essa/oB6vnimg9rh+m3t66g+SYMclgzVs2MDvEj3 VmVOHYNMYPgkJJyC0vDP6+wpc6n8wNHz7lmjrE61vSP9/I7IV+gJkWF3KFmbEqernD dOe87ihG9SvM7Uu3I8Qss7XOMOl1djcULa9yG3nlFcTUWsD4x/zKXI7bTCSBHqjiPH 6nNWRIhgpzwlMuOX+4eYRkLhusbzmdFHkQRh0/7cGuJx0/J3RaXKMoJZtBecMk1vPS sYfFSHI3+Xyytd7Lx0D9tD1VaNAjMYLrGHaVh7hK1L00yScCdbkJ0V7BD7rJNdT4se SzfodwUwkSLog== Date: Wed, 5 Jul 2023 09:20:26 -0700 From: Nathan Chancellor To: Borislav Petkov Cc: linux-kbuild@vger.kernel.org, LKML Subject: Re: [PATCH] kbuild: Enable -Wenum-conversion by default Message-ID: <20230705162026.GA2951@dev-arch.thelio-3990X> References: <20230704221951.7396-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230704221951.7396-1-bp@alien8.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Wed, Jul 05, 2023 at 12:19:51AM +0200, Borislav Petkov wrote: > 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=78736 > > 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) Yes please :) Reviewed-by: Nathan Chancellor > --- > 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 += $(call cc-option,-Werror=incompatible-pointer-types) > # Require designated initializers for all marked structures > KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) > > +# Warn if there is an enum types mismatch > +KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) > + > # change __FILE__ to the relative path from the srctree > KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) > > -- > 2.41.0 >