Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2046375pxb; Mon, 13 Sep 2021 10:44:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1lx5aHPchwXlWYE59GBh0cky9XyDZdfxG29Kgzj4vCIZ6xHTgCqPoJQDaqukYMCPP6tJb X-Received: by 2002:a05:6402:34c2:: with SMTP id w2mr14219383edc.36.1631555097018; Mon, 13 Sep 2021 10:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631555097; cv=none; d=google.com; s=arc-20160816; b=D/THR7pc5OCDLl2BbzzfIemF+e7g0iMkUDy5z1Kx6cX1mb7/FbvYxF9JfCnDthwhYy Jnq+nkhrQvH1mutCqn3ajNWnMxZ+tDMqMgeZlY8/a0DV7eGVGnL+1KmS/zJ5SySdwFE7 St1+kuKnMGV4T38G1rCgA7aDooywDnhnwISsEos8WAa7iH94uZRpjJwabcqcXd5Gstx4 radcja87bGYbwIgWN2yH7Or56egFiNMKnAKA1HkyExwCCFComoXbhacCgAyYkMPAYk9Q z6K1P8gRvf2Pw4XSHngDNMsa+13ZR+IycHMoDabptq4GMfREsPnyGreSP9izeNbPqZP7 aOvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/fXusuKKh/e5rHl3WvKLT7/eIYqq9n/M32FO5AEfQZ4=; b=W8duG3zy8vyZxbhbM1OqAkeJCYA9bcGwd7wUhy2woZ4zTZ8/GLG5bkx6GxnokXCHQd wzqDmHTM3UxzUQWnxOHVwx8jFiYDqVMO6LxkIfvUVg7cBxolmwU4pAvYECxN7nyG9LbH SlwAVTy1DOCewmL8/fg6+XATPGo0HNJT43lTyLQ7CsjV8xEaTAplVg1ITh9rIJ42mPaC AsXCGRB5or4eAymeVk6AVzPsUoRa8VYRytgerz4EGZfUc7Nt2ByJpg8CsjcH/1yhsxcw xOv/a5tqj+hipC+y1QJKXE5xS/IhBfZl5eRJzQWdz2YNkz0OUTfFfTStgcxI9ZWIG0rO jmgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bb8jIWZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si7884733edc.478.2021.09.13.10.44.32; Mon, 13 Sep 2021 10:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bb8jIWZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242563AbhIMRoM (ORCPT + 99 others); Mon, 13 Sep 2021 13:44:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243612AbhIMRoJ (ORCPT ); Mon, 13 Sep 2021 13:44:09 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA85C061574 for ; Mon, 13 Sep 2021 10:42:53 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id h9so22843382ejs.4 for ; Mon, 13 Sep 2021 10:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/fXusuKKh/e5rHl3WvKLT7/eIYqq9n/M32FO5AEfQZ4=; b=Bb8jIWZyUA2JnH1dNvqA8PhazKDoFToI8m/EWHAoOqKLNqV8zTPjzKX6vSeXFJuKyf tIz9q+4BcBJIZrm/Iu+TQqerdjnjQiXXxiZVROuzlUAiYHdpJ05Qtsggzr+XxSztzHDf 1zrSjLLUXzKthlfdL5NA8jPU2NHbiFKkxBxww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/fXusuKKh/e5rHl3WvKLT7/eIYqq9n/M32FO5AEfQZ4=; b=ujHGsBJMbGc74r5Djy5rvVzQpi5ZaxCsAAl6SKor2hkJqZHgEoglV9VXup+qSQCgCX YnQ4zql3kqZIvfnzqi44V7reAQ9ToGtf4RIBDccqxKXDm4ONzqEgF+HjcsvjcT1P9orj M40Q5YmY8eh+xW3EOOxFdKlXg7o28sY2BL0cdZWrbfegzfUmh8rwQsD09UdPat0AAluI b7K27NZiz0PVsMzVTGTZv26N8/HjSz4FRks7xe4HuaHN2OnbWCad+TJPATGQDbVYt+HG PxW64cv461fXRMAmMTS4u4rPdvOowm/gRXYCieNJENWT5/kRCmWh4hRJ1syp+t+4oOHC v1/A== X-Gm-Message-State: AOAM531vKX0qkcKF8AdndOu7K8l6QDVZs1VWq8I2ptyDV8Y/pVBFfKfc 2tk6EWAmhovwpTVi2seXYpJOrgmjBWcYx70Z99w= X-Received: by 2002:a17:906:308d:: with SMTP id 13mr13844423ejv.570.1631554972056; Mon, 13 Sep 2021 10:42:52 -0700 (PDT) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id w13sm4541704ede.24.2021.09.13.10.42.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 10:42:51 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id kt8so22768133ejb.13 for ; Mon, 13 Sep 2021 10:42:51 -0700 (PDT) X-Received: by 2002:a2e:1542:: with SMTP id 2mr11735241ljv.249.1631554960750; Mon, 13 Sep 2021 10:42:40 -0700 (PDT) MIME-Version: 1.0 References: <20210907183843.33028-1-ndesaulniers@google.com> <20210913093256.GA12225@amd> <87a6kgerdk.fsf@oldenburg.str.redhat.com> In-Reply-To: <87a6kgerdk.fsf@oldenburg.str.redhat.com> From: Linus Torvalds Date: Mon, 13 Sep 2021 10:42:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Revert "Enable '-Werror' by default for all kernel builds" To: Florian Weimer Cc: Pavel Machek , Randy Dunlap , Marco Elver , Nick Desaulniers , llvm@lists.linux.dev, LSM List , linux-toolchains@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Guenter Roeck , Kees Cook , Mark Brown , Masahiro Yamada , Nathan Chancellor , Michal Marek , Andrew Morton , Vipin Sharma , Chris Down , Rasmus Villemoes , Daniel Borkmann , Vlastimil Babka , Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 2:50 AM Florian Weimer wrote: > > But there are also warnings which are emitted by the GCC middle-end (the > optimizers), and turning on -Werror for those is very problematic. People say that, but let's face it, that's simply not true. There are real problematic warnings, and we just turn those warnings off. People who want the self-flagellation can enable them with W=1 (or bigger values), and spend their life fighting stupid random compiler warnings that have tons of false positives. But the fact is, I've required a warning-free build on x86-64 for anything I notice for the last several years by now, and it really hasn't been a problem. What _has_ been a problem is that (a) build bots don't care about and (b) the configs I don't personally test (other non-x86-64 architectures stand out, but there's certainly been other configuration issues too). But "bogus compiler warnings" is very much *not* in that list of problems. I've looked at a lot of the warnings that are now errors, and while a number of them have made me go "So why didn't we see that on x86-64?" not one of them has actually made me go "-Werror was wrong". Because EVERY single one I've seen has been for something that should have been fixed. Presumably long long ago, but the warning it generated had been ignored. So stop with the "some warnings just happen" crap. Outside of actual compiler bugs, and truly stupid warnings (that we turn off), that's simply not true. And yes, those compiler bugs happen. The new warning already found one issue with current gcc trunk (non-released). So right now the count is "lots of valid warnings, and one compiler bug that was found _thanks_ to me enabling -Werror". Yes, we have issues with having to work around older compiler bugs. Those aren't going away, and yes, -Werror may well mean that non-x86-64 people now have to deal with them. And yes, this is painful. I'm very much aware of that. But we just need to do it. Because the warnings don't go away on their own, and not making them fatal clearly just means that they'll stay around forever. Linus