From patchwork Tue Sep 28 09:10:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12522223 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82340C433EF for ; Tue, 28 Sep 2021 09:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 670D0611C7 for ; Tue, 28 Sep 2021 09:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239916AbhI1JMs (ORCPT ); Tue, 28 Sep 2021 05:12:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239886AbhI1JMr (ORCPT ); Tue, 28 Sep 2021 05:12:47 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B60CC061575 for ; Tue, 28 Sep 2021 02:11:08 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id k11-20020a4abd8b000000b002b5c622a4ddso1625286oop.1 for ; Tue, 28 Sep 2021 02:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QRteyXp7zJ26l8jvSxxivYT8yfLceUcxnxd2vvRt2Xc=; b=HnDxFVO7UmTmQJwEl7bdaH74BivpphKnIKHIURtuVQWj4XzzcdJ+EdtJHwDfVoGkA0 beIC1ZT7ixyrGSnEq44fXLApdYDcNAf7rS5HZ+STzlQ9A+fOf0S8Iv8BVwpFH7AjK5pr 0hy27kdqcNkQP8FE6gPf6i/SqFA7K0Vsi8fqV+5WlDaYOPK+hhs18UuahZwQYDuXd9qu sUeYFwvExbIXYPGzxiCX4mziCIIsIJB0juUm78V//ktOJeflW6GOcp2sFwkd2umfKeUr yDkXzHlbONLfI638i91bxWzxaqqXlwaV3AKvOhdvNXUKWfYBKgUHpSseL8rkHIwtR26m wKGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QRteyXp7zJ26l8jvSxxivYT8yfLceUcxnxd2vvRt2Xc=; b=aviN8QrEgNL1iaNnWNaxwffJzBeATUwg3uAcVTDMrZDpHkUbH6DPx5qLuFjab7k7Gj F9RDE2im8oyCY0/BgE4pffbClP7UBbRQiY45L5a1CHsP1I7tM7bx7IHKN/OnhuxEjAGM 3sS3bl25XgQFM0Qj2fLXbhT4EQ0XscEJpYk3c4yA0j0WGc6AL88pxwxRDZFHqy7p9zYf tH+22eDQ0czPBAK/tgFhx2Sa+Kn4BpXhbM3KzhDoP5p9sP494MJRdQUIPri8zAQzJFCt QmAZf3itaWAIRQXseY1Vx1h7NdgeBrFBymbSRH4okPcJPN+EizVHNduLlj1dU8VDCcL2 ZYUA== X-Gm-Message-State: AOAM533LUO4J5xthgLKkCcJoxO5FcF6CmxmLLcng10SRKz3wzlfbGizd 4Yb4qqN0iS0aIGaBDR+zmUu+VDb3obJFWQ== X-Google-Smtp-Source: ABdhPJxqYJijK37UsfxNwhuwRonBoSGbHCL2I7bXB4p3mI3ycJYk8klJXctchBE4iTRuybNrkIXTew== X-Received: by 2002:a4a:c90a:: with SMTP id v10mr3973441ooq.83.1632820267389; Tue, 28 Sep 2021 02:11:07 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id r23sm4441250otu.54.2021.09.28.02.11.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 02:11:07 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: t.gummerer@gmail.com, avarab@gmail.com, pclouds@gmail.com, jonathantanmy@google.com, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 1/3] Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format better Date: Tue, 28 Sep 2021 02:10:52 -0700 Message-Id: <20210928091054.78895-2-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210928091054.78895-1-carenas@gmail.com> References: <20210928091054.78895-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 6a8cbc41ba (developer: enable pedantic by default, 2021-09-03) enables pedantic mode in as many compilers as possible to help gather feedback on future tightening of the net, so lets do so. -Wpedantic is missing in some really old gcc 4 versions so lets restrict it to gcc5 and clang4 (it does work in clang3 AFAIK, but it will be unlikely a developer will use such an old compiler anyway). MinGW gcc is the only one which has -Wno-pedantic-ms-format, and while that is available also in older compilers, the Windows SDK provides gcc10 so lets aim for that. Note that in order to target the flag to only Windows, additional changes were needed in config.mak.uname to propagate the OS detection done there. Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.dev | 6 +++++- config.mak.uname | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.mak.dev b/config.mak.dev index cdf043c52b..c81be62a5c 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -9,11 +9,15 @@ endif DEVELOPER_CFLAGS += -Wall ifeq ($(filter no-pedantic,$(DEVOPTS)),) DEVELOPER_CFLAGS += -pedantic +ifneq ($(filter clang4 gcc5,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wpedantic -ifneq ($(filter gcc5,$(COMPILER_FEATURES)),) +ifneq ($(filter gcc10,$(COMPILER_FEATURES)),) +ifeq ($(uname_S),MINGW) DEVELOPER_CFLAGS += -Wno-pedantic-ms-format endif endif +endif +endif DEVELOPER_CFLAGS += -Wdeclaration-after-statement DEVELOPER_CFLAGS += -Wformat-security DEVELOPER_CFLAGS += -Wold-style-definition diff --git a/config.mak.uname b/config.mak.uname index 76516aaa9a..aa68bbdec7 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -589,6 +589,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL) SHELL_PATH = /usr/coreutils/bin/bash endif ifneq (,$(findstring MINGW,$(uname_S))) + uname_S := MINGW pathsep = ; HAVE_ALLOCA_H = YesPlease NO_PREAD = YesPlease @@ -705,6 +706,8 @@ ifeq ($(uname_S),QNX) NO_STRLCPY = YesPlease endif +export uname_S + vcxproj: # Require clean work tree git update-index -q --refresh && \ From patchwork Tue Sep 28 09:10:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12522225 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 274A0C433EF for ; Tue, 28 Sep 2021 09:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09FD660F44 for ; Tue, 28 Sep 2021 09:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239930AbhI1JMw (ORCPT ); Tue, 28 Sep 2021 05:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239903AbhI1JMs (ORCPT ); Tue, 28 Sep 2021 05:12:48 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F8DC061575 for ; Tue, 28 Sep 2021 02:11:09 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id o59-20020a9d2241000000b0054745f28c69so26040356ota.13 for ; Tue, 28 Sep 2021 02:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o+Xgnb+em+kZz5AWvxVo2po/1w+2VKMitOmKDJOHW4M=; b=m4jgHfz1CXfrmJtfKsv+Bkpj9koj07LH9JYfb2AvAKzNWec9z0Pkq7yq/hkUaqsZuF Zd3/JeMrQ7c/0riHIQIDftpP+o/cmBhUxBjHxy2qfEmgftLtHxv130J5jOh8dO02oeDf W3GR4bqUQX67+hlGPlq8w0PtlY6M3bqms3FdZumsH7wnuIpXjTeDsTF6pF4U0EOhY/pJ yNr12dUODdFr1tp7zhBUlXRoeaorbIZERG2Gz0Vsz06B40sly7pQ8yuZxLc1Oc+8c3PG Cgx/pYrNpXmvU8ADB5cEuvDOwXHJ0L4+ERzQquxti+KQ29QZECCl5vKZSU9rQVnL2fmB 22EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o+Xgnb+em+kZz5AWvxVo2po/1w+2VKMitOmKDJOHW4M=; b=QnZ10q8SmZCie46cGZTvZVjR52Zy6EvRG24bxLeb6aH4zWzzrlEvISu+K1fInEzBwz ECkKx0TcYEM/aMZ099ZOy/plAzuJk6BtZ4xla6neKwRnnQ8USQ/uIyhxJHA2lMsvnZWS LkUMBeQ9iDDefJYH2IYckCY3zI7eVarO29Pue6n9SX/iaFYWLP6+ckC3rbD/990GtMs6 +P8IOEb1dfqB8kkps9oZCrMFOdJKOOr/M+gWH0w7fcKtyCpPhwBdACU2rhlcjC5WrbUM SaHYhA70TlldC61Iq4OnOolAmWYfQ2DEqQXX3Cm7ajqzeEewbAnlTsc7v/6WOhP/NDaz YZlA== X-Gm-Message-State: AOAM533dXAGeCa0+/lb/EKrbCBinJn3/MZKzDNeWQXLflAjTfkkGFIVy ZNy+UY0ubtFS9tT0Qb2Za1OQ7RguEXWYDQ== X-Google-Smtp-Source: ABdhPJy0bp0yakcVKxQmJqT4dnwt3i68ZAQDH51o3t5JHgSyVBQoOVSNPUTwM0Y/KnnBEArODM873Q== X-Received: by 2002:a9d:6752:: with SMTP id w18mr4126966otm.117.1632820268481; Tue, 28 Sep 2021 02:11:08 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id r23sm4441250otu.54.2021.09.28.02.11.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 02:11:08 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: t.gummerer@gmail.com, avarab@gmail.com, pclouds@gmail.com, jonathantanmy@google.com, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 2/3] Makefile: avoid multiple -Wall in CFLAGS Date: Tue, 28 Sep 2021 02:10:53 -0700 Message-Id: <20210928091054.78895-3-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210928091054.78895-1-carenas@gmail.com> References: <20210928091054.78895-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 6163f3f1a4 (config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users, 2018-10-12) adds a second -Wall in config.mak.dev to workaround the lack of one from config.mak.autogen. Since 6d5d4b4e93 (Makefile: allow for combining DEVELOPER=1 and CFLAGS="...", 2019-02-22), that variable is set instead as part of DEVELOPER_FLAGS which won't be overriden by config.mak.autogen, so it can be safely removed from config.mak.dev if set instead in the Makefile. This also has the advantage of separating cleanly CFLAGS which are used for building with the ones that provide with diagnostics. Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 3 ++- config.mak.dev | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9df565f27b..963b9e7c6b 100644 --- a/Makefile +++ b/Makefile @@ -1200,7 +1200,8 @@ endif # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be # tweaked by config.* below as well as the command-line, both of # which'll override these defaults. -CFLAGS = -g -O2 -Wall +CFLAGS = -g -O2 +DEVELOPER_CFLAGS = -Wall LDFLAGS = CC_LD_DYNPATH = -Wl,-rpath, BASIC_CFLAGS = -I. diff --git a/config.mak.dev b/config.mak.dev index c81be62a5c..90c47d2782 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -6,7 +6,6 @@ ifeq ($(filter no-error,$(DEVOPTS)),) DEVELOPER_CFLAGS += -Werror SPARSE_FLAGS += -Wsparse-error endif -DEVELOPER_CFLAGS += -Wall ifeq ($(filter no-pedantic,$(DEVOPTS)),) DEVELOPER_CFLAGS += -pedantic ifneq ($(filter clang4 gcc5,$(COMPILER_FEATURES)),) From patchwork Tue Sep 28 09:10:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12522227 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87C9DC433F5 for ; Tue, 28 Sep 2021 09:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69DD160F44 for ; Tue, 28 Sep 2021 09:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239937AbhI1JMz (ORCPT ); Tue, 28 Sep 2021 05:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239827AbhI1JMt (ORCPT ); Tue, 28 Sep 2021 05:12:49 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A71C061575 for ; Tue, 28 Sep 2021 02:11:10 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id r43-20020a05683044ab00b0054716b40005so21220237otv.4 for ; Tue, 28 Sep 2021 02:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WRtAoP1syZyLmIxeGZtnMNTXV30+xMCVvhWxVYoxkbM=; b=ZeGiXg0eQe3NwKAeUlgpu0zlORHKFAkniHRh0iciAY9f+455p3BKkxNr7mC8lLCVW+ iBAgPKT6oCSxUKbNeo3LRYq+FVU52bjW6HAamWlM4N7RsK1N+dB8v4Wlg5y1yNgCwQCm e8UcpL5C9GDvnhqpow5/+cisdNeGxLxs66YGX9f7IEE9BapZICnVTvaoznEXFoo9KYXz 1yg/maIpcRcMCwaEp1LDE6ZWqk2W3BdgOeBFEA6oK1o8p9aIaTkENF4E5KnPD3AVd0bm 0y3Rr3jb9GCj37h0XcYs22ZIdWhASyT0fQ1W/gOQRjw0c1sqNDvbH+r093c4wvtwpLTa iucg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WRtAoP1syZyLmIxeGZtnMNTXV30+xMCVvhWxVYoxkbM=; b=Q9n1XqhgMCvIk6S8OQZyeGWu6qoN9/YaftmsIBbWTqhqr7tvTJnP0Lr8KucDlHUtZR x7mwoO+c54J/boEKJmKrQ14dmuz7nrLk8KcpzCYflfBTpK464dIEzQZoIvCe8WkuCp2b lIg5WU7V2rcPNnpNWyDaPN03UByPAMGl30L4QqN8P1zK4zw03jiWc7oCceDAsWqcJDb8 BfpC0Q9TVM/q+jmOLgpN3VQy1R/tWhAXv16KQANpYN0y/zW9pTmFZuiwJzTy0i7rzEVv 2NaLRfb3B4MnhJ+cFyraiFxfBpphMDsSVDcjhdaVaurXgtCVpn8BMTW8oZrFgGS4aZ7y zAEA== X-Gm-Message-State: AOAM533QOS/WKYJ+Ce0wnbvmQyjEH/yWJC4mdf9gtgOmZMnSLORqGyqh cNKfj28WU89kBE4i0mc7R9dTy1YOsXcKhQ== X-Google-Smtp-Source: ABdhPJzlC14/MZg0eX1IRMftEZUJEJgmljztz3hQbio2Y09wuEaXswn0gZD74ibUcFYODlyXsO1YIQ== X-Received: by 2002:a9d:64c8:: with SMTP id n8mr4170031otl.188.1632820269416; Tue, 28 Sep 2021 02:11:09 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id r23sm4441250otu.54.2021.09.28.02.11.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 02:11:09 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: t.gummerer@gmail.com, avarab@gmail.com, pclouds@gmail.com, jonathantanmy@google.com, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 3/3] config.mak.dev: simplify compiler check for multiple compilers Date: Tue, 28 Sep 2021 02:10:54 -0700 Message-Id: <20210928091054.78895-4-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210928091054.78895-1-carenas@gmail.com> References: <20210928091054.78895-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 1da1580e4c (Makefile: detect compiler and enable more warnings in DEVELOPER=1, 2018-04-14), includes an $(or) of two different filters to check for both gcc and clang versions. As shown in a previous patch, a simpler syntax is available so apply the same logic here also for consistency. Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mak.dev b/config.mak.dev index 90c47d2782..b66fae8665 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -31,7 +31,7 @@ ifneq ($(filter clang4,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare endif -ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),) +ifneq ($(filter clang4 gcc6,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wextra # if a function is public, there should be a prototype and the right # header file should be included. If not, it should be static.