From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 908573FD6 for ; Mon, 13 Sep 2021 09:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631526645; 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=bcxT/nYCt1HfAKtcDpLnPTM8jW84o9paV8oFdZQca4Wekbqa910O6nAmJm1sOQVY82MvFF L11D9CnWttpO3OknhiogCut1nvBsudDdEXnHKqBogUYG2Vb3zD6lJ0EQIzTg079/lrzb6l TQaAsa+kcMUG2/OxX5rVdIxVC0xY2QI= 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) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 * 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