Message ID | 20230803-nolibc-warnings-v3-14-bcc1a096ae02@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp974118vqx; Thu, 3 Aug 2023 00:39:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEkPV6GaFMH1+QiuN5C1tYrV3uuNDYZZp6dPT0SkDGe1TxribCGVHdZAfJkFQzlr5R5MY/G X-Received: by 2002:aa7:cf97:0:b0:51e:5322:a642 with SMTP id z23-20020aa7cf97000000b0051e5322a642mr7158578edx.27.1691048352867; Thu, 03 Aug 2023 00:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691048352; cv=none; d=google.com; s=arc-20160816; b=Z1o0dqGc+HKbSzrKiTadcHUdkBCPJlEBu4mqoBMLwV300s1QPxswD56nxYUVwvOxju Zjy60D27JqHCa0IRTC1J5rDcUvYj7BpTduzxE+KRHazS/vOSIMKXCiNc6G5H4sPEMn1o nsAw5Q/HBdvmqDnLogGQLHzPhw7gGQxH3xw28l4Mvo6qi69McH2lt51BMrUXttxtTfbY mCjgwVhO4Igwd6Jz1tmL+9EH0JPbWoPJau8n4vdc0Iakx594uBGMlutFNp8bRo4rtWnv 5KxV3l0V3c7a/NWI6rFNI8HhwhmrWkY4cRIml5O+jZgqhB2uG+n7g8/yWWhAlldvvgVj Q3hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=2b8eornrJMk0NEmsOgDyoK31VIgOezKU6Zf5sCAgGSQ=; fh=UZfhiU2pgwvZdBOe9fFEhnfTQX0/6KsvXKQubWsfhik=; b=bKAQ6vLKkTyLkH5FLW9dWh0jbrVDxPYzDukWWUq1Ct3UJDulKNpg9pMvQOGtSn3Rv9 tEz+CFcP3jxkkU1JjXG+/3jRiTOaERguAL8R1GI4aHFQMsu8wREW9XJMUqwgGupZGKZN WmpYia8GENQrYo9iCUf6NFDNuy+o1R7bP2V0ZracWw9yG0H5vye3vhA8sSa3WkQ/2I8q HBNM8l+OvUjl0a2CN6yedjwkYEWCYg5IiQsp/fOgVYtpk582LsoIqXg9JnT7ZIWXbUzG v7E8oWJeRBAEwX1HLMO/crlu3vrbP+3kSVZBiDxoLrKIAKiCdtmha/VaIDEl84cjFwOG Wc4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=RnfIHQ4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020aa7cf8d000000b005223eaf48a2si10559583edx.268.2023.08.03.00.38.48; Thu, 03 Aug 2023 00:39:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=RnfIHQ4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233937AbjHCH3p (ORCPT <rfc822;jeff.pang.chn@gmail.com> + 99 others); Thu, 3 Aug 2023 03:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232332AbjHCH2z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Aug 2023 03:28:55 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB1330E4; Thu, 3 Aug 2023 00:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1691047729; bh=1prHYeNa2m6PDgxlomejHbEUeEH+xZuFmSaJoOFEhcA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RnfIHQ4uiH5HSosRYOtPrfz3SG7UZZdVfxMWZIyctFa6g5w98vl7xf4DoXXEhMOkK ij9Uq5rOn/j0634l3LNLEZZTZdSKgezgZuRdM4SgcuZthdPehKrLCvzxaOaBn3FbJy pPHiA1ZYoR5xGxS52k7Je82P7A6Wm9hVUXeLmAcc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> Date: Thu, 03 Aug 2023 09:28:58 +0200 Subject: [PATCH v3 14/14] selftests/nolibc: enable compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230803-nolibc-warnings-v3-14-bcc1a096ae02@weissschuh.net> References: <20230803-nolibc-warnings-v3-0-bcc1a096ae02@weissschuh.net> In-Reply-To: <20230803-nolibc-warnings-v3-0-bcc1a096ae02@weissschuh.net> To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org> Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan <tanyuan@tinylab.org>, Zhangjin Wu <falcon@tinylab.org>, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1691047727; l=921; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1prHYeNa2m6PDgxlomejHbEUeEH+xZuFmSaJoOFEhcA=; b=gj5nyYlAoM82Al6l1w7dDRxZVxTU9JPlDlrOyLJNu97fgOVQhH4+8ltb5nxU+MiP+nves7IJL z/BUpARrFpkA1mZ/6pgJ8tyToiYcoo9e+OrV7MPLJ/hDUvwY9elLR7H X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773192717698437999 X-GMAIL-MSGID: 1773192717698437999 |
Series |
tools/nolibc: enable compiler warnings
|
|
Commit Message
Thomas Weißschuh
Aug. 3, 2023, 7:28 a.m. UTC
It will help the developers to avoid cruft and detect some bugs.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Aug 03, 2023 at 09:28:58AM +0200, Thomas Weißschuh wrote: > It will help the developers to avoid cruft and detect some bugs. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > tools/testing/selftests/nolibc/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > index b82d29b6c37f..e8d09cbee2ab 100644 > --- a/tools/testing/selftests/nolibc/Makefile > +++ b/tools/testing/selftests/nolibc/Makefile > @@ -79,7 +79,7 @@ endif > CFLAGS_s390 = -m64 > CFLAGS_mips = -EL > CFLAGS_STACKPROTECTOR ?= $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) > -CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \ > +CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \ > $(call cc-option,-fno-stack-protector) \ > $(CFLAGS_$(ARCH)) $(CFLAGS_STACKPROTECTOR) > LDFLAGS := I'm now getting this with gcc < 9: nolibc-test.c: In function 'test_pipe': nolibc-test.c:811:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (len != strlen(msg)) ^ The reason is that len is ssize_t and strlen() is size_t. I tried different approaches here but the cleanest remains turning len to size_t (we don't use its sign anyway), so I'll do that one as well. Cheers, Willy
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index b82d29b6c37f..e8d09cbee2ab 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -79,7 +79,7 @@ endif CFLAGS_s390 = -m64 CFLAGS_mips = -EL CFLAGS_STACKPROTECTOR ?= $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) -CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \ +CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ $(CFLAGS_$(ARCH)) $(CFLAGS_STACKPROTECTOR) LDFLAGS :=