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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2A8DC6FD19 for ; Fri, 10 Mar 2023 09:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229900AbjCJJba (ORCPT ); Fri, 10 Mar 2023 04:31:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbjCJJbJ (ORCPT ); Fri, 10 Mar 2023 04:31:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2602D5A928 for ; Fri, 10 Mar 2023 01:28:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D336DB821EE for ; Fri, 10 Mar 2023 09:28:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04EF3C433D2; Fri, 10 Mar 2023 09:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678440492; bh=o86gqTQ/rTfGe5zAXhQTcKjlfhTtUOrfS2KP4sHCoOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hP8t1IJUQMBupLQ2B0hoWZ0fobtDTXAYvZtrwmkhAaeEQvtUxu2mZLu2fYI/AKQgk C55LYtrRuiKeBLoT71C87y2xYZAwfASObDuEhlCSrt98fTU3c9bz/5WNjkmydw2u9k TS0OQDiMYtRPIOYc8y6t6PIzFu6Xmezkzzw5T/po= Date: Fri, 10 Mar 2023 10:28:09 +0100 From: Greg KH To: Vincenzo Palazzo Cc: x86@kernel.org, luto@kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v1] x86: suppress warning generated by W=1 Message-ID: References: <20230309174854.350143-1-vincenzopalazzodev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Fri, Mar 10, 2023 at 10:19:53AM +0100, Vincenzo Palazzo wrote: > On Fri Mar 10, 2023 at 8:33 AM CET, Greg KH wrote: > > On Thu, Mar 09, 2023 at 06:48:54PM +0100, Vincenzo Palazzo wrote: > > > suppress unused warnings and fix the error that there is > > > with the W=1 enabled. > > > > Why are you building with that option enabled? It's not a normal one at > > all. > > I was using this option because I would like to see if my c code has > warnings, but currently it is not possible compile the kernel with > W=1. Yes, that is the main issue here, the kernel does not build cleanly for lots of good reasons (i.e. foolish compiler warnings that are not actually pointing out a real problem), so that option is not enabled by default right now. So this change is not needed right now, perhaps you can fix up the compiler to not make this type of warning for code that is correct? > Maybe I'm missing a little bit of history here, this is not the correct > option to compile the kernel with -Wall? Yes, but the kernel does not build cleanly with that option, as you have found out. Fixes for when the kernel code is wrong is great to have, but not at the expense of "we are doing this only to shut up the compiler because it does not understand our code" like you are doing here, sorry. thanks, greg k-h