Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1669081pxb; Mon, 13 Sep 2021 02:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrNmP/Fc452QKV8gB8aZV2jYlm7vJpM7gA+okzOdqvsGzu2s5cXMRftL73UutzUbypBsMY X-Received: by 2002:a92:c211:: with SMTP id j17mr2408375ilo.57.1631526807987; Mon, 13 Sep 2021 02:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631526807; cv=none; d=google.com; s=arc-20160816; b=QmP13EGDIDVVWlcizYCmtYxWJFjzLCh8KZ2OcmdbUNccNU4TrGBPsX0FdM+fHizP4B NMuJYrCtUZoVddnnfN8YOnq+b39nKYsFL4mI4uiSM5JJWzt7FlSwQ7IQohkNL83IJ4IV vv3Nt/64n66b+6cfuY9vheJ3d+hCmtCTQ/nTo2uuu+d5J4etg6DYJE5TIEkEbBkuai8b tB7XHFX8JuQdD9dn7w5yxheytAKhkMQJDohCbG7eyOpr3UbYinx2NBukM6l2/M45pBNF ZeD0Hk6NLc/4CpSYvR1Jlywy/6hSSTODq5tzyDEdWs79jiSeEQje3V01OrMpD8p0RUwO lbkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=FWYCzeGtceqA/rq/kRIZJcCWrApBFOcolNNuHNemAH8=; b=za3wbngmSZntTwSKmhM+xI+dTd/CwKwFwZd0b9YeZd08Qr9vecELlERYcmszJpn6ZB H8RUhDkozpjbHKsEpfHz783PTcV4BHEk4GSUXm5EBD0sDu199TJjq7VIch8HFiYMxOeW wIb+qo660N2iku2HWwVnPHqIU8irqXic0mMwDh3/1bdo8wRTL9T21i9NTv05maTN6fi9 4+muEroJRdu61cW724Nv4ZL3dws9b0fXnzySXgPXntsd/+Ozts8tARY8zwPCXhEZYgk6 Cr6OJpHR7RMlw1yYOqd7DD8JJ7cb7cIXLwrqjdVQKIzmthNa/fDCX3B4KPF/C8/Uz28y YzZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EMaGuPL5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k35si6350938jac.46.2021.09.13.02.53.15; Mon, 13 Sep 2021 02:53:27 -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=@redhat.com header.s=mimecast20190719 header.b=EMaGuPL5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238849AbhIMJwF (ORCPT + 99 others); Mon, 13 Sep 2021 05:52:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54413 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237875AbhIMJwD (ORCPT ); Mon, 13 Sep 2021 05:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631526647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FWYCzeGtceqA/rq/kRIZJcCWrApBFOcolNNuHNemAH8=; b=EMaGuPL5SqWRRfaB/RdGMbH4mrLMXbINagBHPkKNl+T+yJC3jcjt8jWNsRbgHTQzoC4Pfz +uo3zp0vg9GwdXIHPetGGvesz+9VDb28CsSyT1JFarMekGE0F6SrBUdjCHqXZlWzCCFsm0 e72WiqoAEKrmm+05LRdDdDRACwtw9Ok= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-ySxaI00DMc2dKdYIgVhaQw-1; Mon, 13 Sep 2021 05:50:44 -0400 X-MC-Unique: ySxaI00DMc2dKdYIgVhaQw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21ED4802B9F; Mon, 13 Sep 2021 09:50:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.195.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AEAC01972E; Mon, 13 Sep 2021 09:50:33 +0000 (UTC) From: Florian Weimer To: Pavel Machek Cc: Randy Dunlap , Linus Torvalds , 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 Subject: Re: [PATCH] Revert "Enable '-Werror' by default for all kernel builds" References: <20210907183843.33028-1-ndesaulniers@google.com> <20210913093256.GA12225@amd> Date: Mon, 13 Sep 2021 11:50:31 +0200 In-Reply-To: <20210913093256.GA12225@amd> (Pavel Machek's message of "Mon, 13 Sep 2021 11:32:56 +0200") Message-ID: <87a6kgerdk.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Pavel Machek: > Do we really want developers treat warnings as errors? When the code > is okay but some random version of gcc dislikes it... There are some warnings-as-errors which are quite reasonable, like -Werror=implicit-function-declaration (which we can't make the compiler default without cleaning up userspace first) and perhaps -Werror=implicit-int. Some other warnings can be used to enforce coding style, and there -Werror could make sense as well (-Werror=vla and others). But there are also warnings which are emitted by the GCC middle-end (the optimizers), and turning on -Werror for those is very problematic. These warnings are very target-specific and also depend on compiler version and optimization parameters. Unfortunately that includes the buffer size warnings based on function attributes (which would otherwise be a good fit for the kernel because it uses few external headers). GCC also lacks a facility to suppress warnings if they concern code that was introduced during optimization and removed again later (e.g. inlining, constant propagation, dead code removal). Thanks, Florian