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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E04CC001DC for ; Mon, 31 Jul 2023 08:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbjGaIOD (ORCPT ); Mon, 31 Jul 2023 04:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbjGaINQ (ORCPT ); Mon, 31 Jul 2023 04:13:16 -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 ABAFD1723; Mon, 31 Jul 2023 01:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690791036; bh=VVBFsacjEVmUUG4a0c8yaWevpfLl40G7Jll0Zstz/vs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TXUNAYagpG6NiEnger4e6aCr8xHINobNmTVYGqfCmLXBAJ/hvoR94T3h6fZoDAgej +4WKDUw0OwmKtLchCuJJ45yqghfN91OEs6XD45QBcDusblHk1l/V3gAj4tMo1Zy6oL 0LRAIAVe0p/fFYwXRziKMJ7b6FvTG2QcKyIa25I0= Date: Mon, 31 Jul 2023 10:10:36 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Zhangjin Wu Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, tanyuan@tinylab.org, w@1wt.eu Subject: Re: [PATCH 4/4] selftests/nolibc: enable -Wall compiler warnings Message-ID: <940dcf77-05ae-4cf6-b5f0-5b8cf80adab6@t-8ch.de> References: <20230731-nolibc-warnings-v1-4-74973d2a52d7@weissschuh.net> <20230731071718.21085-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230731071718.21085-1-falcon@tinylab.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-07-31 15:17:18+0800, Zhangjin Wu wrote: > > It will help the developers to avoid cruft and detect some bugs. > > > > Signed-off-by: Thomas Weißschuh > > --- > > 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 f42adef87e12..72227d75c6da 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 -Wall \ > > Very good static analyzer support. > > What about further add more options? > > +CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -Wall -Wextra -Werror\ > > A simple test shows, it can catch more issues. -Wextra will need some further rework for 32bit architectures to avoid some warnings. (At least mips for which I tested it) I don't think -Werror is appropriate. If we want to test the functioning of nolibc with weird compilers these may very well add new warnings and that shouldn't break the build. > > Thanks, > Zhangjin > > > $(call cc-option,-fno-stack-protector) \ > > $(CFLAGS_$(ARCH)) $(CFLAGS_STACKPROTECTOR) > > LDFLAGS := -s > > > > -- > > 2.41.0