From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 339ADC433FE for ; Mon, 13 Sep 2021 09:50:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 198A661040 for ; Mon, 13 Sep 2021 09:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238843AbhIMJwF (ORCPT ); Mon, 13 Sep 2021 05:52:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50886 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238043AbhIMJwD (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: * 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