Message ID | 20230328-nolibc-c99-v2-0-c989f2289222@weissschuh.net |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1323728vqo; Thu, 6 Apr 2023 14:56:44 -0700 (PDT) X-Google-Smtp-Source: AKy350bTa+pBNfxFz8ySWymJWOt15gjxPXTxqpHs2htDG8jXTs0Cav+jSyKZgW9lV9yB+63Ls0eP X-Received: by 2002:aa7:954e:0:b0:628:bf87:54c1 with SMTP id w14-20020aa7954e000000b00628bf8754c1mr424658pfq.6.1680818203964; Thu, 06 Apr 2023 14:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680818203; cv=none; d=google.com; s=arc-20160816; b=qW4wmSD+ybrwLqdtLDgJgKS2qjQSaDqPPKI7hDSOJTCQQn5uHz9Ii623Q5Y0Gn9Djt ggQ8E93hEod0352FZ49NGcPiqGFlsfwZl0bFtCe2pPszLKwISkrAZV2xxuO2eUhJ4XOY Hg6t1U9Ec/wJ0Phxy2nBlmnb09xLvGwXppo0l7aPVGQ563dZVyosOwSTrwUkIaG7J80S S6VzVbILwsv4D/aAvwuyE+ToGdwg5w51B37782zo4Vf/B0dT2lcsa08dxA1y/rbW1DFP xj7Ya92sQ7JaNNw/zlHEwJTCekXep9K4ar6zLthUCY9aSuvy/QPX1TGpniWAM4nVAAgd TBMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:dkim-signature:from; bh=DohKsPpURdk3K/lTdysR5dMZ50wf5ROeUukYgY5TvcE=; b=D4pqMS7oMgfnytnewuAZJ1gjcRsoqQuW4JWSllPWBu8nY1r5Gq/aggBi2S7z0U+rn1 q/ZFzsr4JhqTUa6tvutFs8CHGAj26Fnbh+z0ZpSbnQ+yesVRcpeQERCVKamSXZsnB4i2 UKHfZ2/iAI8Eq4rMG9Qab8pGCStXaBuAqCFJohGFU1cHhFGWw2ixEo5aciZ3jPBr1j/e Z864c4uU2hLbaXRXKHUVoFcUZp1tNGha/oDNPptE1cJPqcQ/bTX4f8plZIi055CKm1yK 6CvG7KpsU75fchjrjr+RC8UzHYUmhwrO+O4vuyuN5xoq0R64zail9T9dP2Y2F7P1O9Vm EOrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Mm0s0hRg; 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 q17-20020aa79831000000b006280cd49409si2277134pfl.21.2023.04.06.14.56.30; Thu, 06 Apr 2023 14:56:43 -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=Mm0s0hRg; 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 S230016AbjDFVzA (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 6 Apr 2023 17:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjDFVy4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Apr 2023 17:54:56 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1330DA5FF; Thu, 6 Apr 2023 14:54:54 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1680818092; bh=vTkw79wXmjqLnNQjs+gxqaE5Rm4KsNN2M5mSIaE9oJQ=; h=From:Subject:Date:To:Cc:From; b=Mm0s0hRgTzcaYnyrDom104CHBUL+Fjqf1lvCK9FOVsjcwpenNmlo/+HpFDmDRnxah 82mKImdlWW7q9TNn15zik+TGvhLcTy8Y7stViTUx4aZ+m5dscpTsOhM8lLMAKBAZxQ 6tDXoOFESU81HAtoirFavLl/u6s+zdBBjf3q3uTQ= Subject: [PATCH v2 00/11] tools/nolibc: -std=c89 compatibility Date: Thu, 06 Apr 2023 21:54:46 +0000 Message-Id: <20230328-nolibc-c99-v2-0-c989f2289222@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAKY/L2QC/22NQQ6CMBBFr0JmbQ1tgVBX3sOwaOvUTkKK6QBqC He3snb5XvL/24AxEzJcqg0yrsQ0pQLqVIGPNj1Q0L0wqFrpWqtepGkk54U3RrQmNA3apu10B2X gLKNw2SYfyyQt41jkM2Og91G4DYUj8TzlzxFc5c/+/V6lkML2ulbBSROkub6QmNnHJZ4TzjDs+ /4FrdzMCL4AAAA= To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org> Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680818091; l=2524; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=vTkw79wXmjqLnNQjs+gxqaE5Rm4KsNN2M5mSIaE9oJQ=; b=u8ffBBBHpKO4SHr4y2hSWddmtXo0ReO8KKTrSymF304NsOzmHrbKVqYAYkSMTc6v29MXR7vsg YhPYYU897SxBe+QxpBaPoOxMAwc9F7wDlTVpKWqCrNbmrAd3tgdrmBH X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762465629042928850?= X-GMAIL-MSGID: =?utf-8?q?1762465629042928850?= |
Series |
tools/nolibc: -std=c89 compatibility
|
|
Message
Thomas Weißschuh
April 6, 2023, 9:54 p.m. UTC
This series replaces the C99 compatibility patch. (See v1 link below).
After the discussion about support C99 and/or GNU89 I came to the
conclusion supporting straight C89 is not very hard.
Instead of validating both C99 and GNU89 in some awkward way only for
somebody requesting true C89 support let's just do it this way.
Feel free to squash all the comment syntax patches together if you
prefer.
All changes in this series are cosmetic only.
To: Willy Tarreau <w@1wt.eu>
To: Shuah Khan <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This series is based on the "dev" branch of the RCU tree.
---
Changes in v2:
- Target C89 instead of C99
- Link to v1: https://lore.kernel.org/r/20230328-nolibc-c99-v1-1-a8302fb19f19@weissschuh.net
---
Thomas Weißschuh (11):
tools/nolibc: use standard __asm__ statements
tools/nolibc: use __inline__ syntax
tools/nolibc: i386: use C89 comment syntax
tools/nolibc: x86_64: use C89 comment syntax
tools/nolibc: riscv: use C89 comment syntax
tools/nolibc: aarch64: use C89 comment syntax
tools/nolibc: arm: use C89 comment syntax
tools/nolibc: mips: use C89 comment syntax
tools/nolibc: loongarch: use C89 comment syntax
tools/nolibc: use C89 comment syntax
tools/nolibc: validate C89 compatibility
tools/include/nolibc/arch-aarch64.h | 32 ++++++++--------
tools/include/nolibc/arch-arm.h | 42 ++++++++++-----------
tools/include/nolibc/arch-i386.h | 40 ++++++++++----------
tools/include/nolibc/arch-loongarch.h | 38 +++++++++----------
tools/include/nolibc/arch-mips.h | 56 ++++++++++++++--------------
tools/include/nolibc/arch-riscv.h | 40 ++++++++++----------
tools/include/nolibc/arch-x86_64.h | 34 ++++++++---------
tools/include/nolibc/stackprotector.h | 4 +-
tools/include/nolibc/stdlib.h | 18 ++++-----
tools/include/nolibc/string.h | 4 +-
tools/include/nolibc/sys.h | 8 ++--
tools/testing/selftests/nolibc/Makefile | 2 +-
tools/testing/selftests/nolibc/nolibc-test.c | 14 +++----
13 files changed, 166 insertions(+), 166 deletions(-)
---
base-commit: bd5b341f0f69eb4c958ffd48699213c5b9af8145
change-id: 20230328-nolibc-c99-59f44ea45636
Best regards,
Comments
Hi Thomas, On Thu, Apr 06, 2023 at 09:54:46PM +0000, Thomas Weißschuh wrote: > This series replaces the C99 compatibility patch. (See v1 link below). > After the discussion about support C99 and/or GNU89 I came to the > conclusion supporting straight C89 is not very hard. > > Instead of validating both C99 and GNU89 in some awkward way only for > somebody requesting true C89 support let's just do it this way. > > Feel free to squash all the comment syntax patches together if you > prefer. I gave it some thought, at first considering that going lower than GNU89 was possibly not very useful, but given that the changes are very small in the end (mostly comments formating), I think that you're right. The cost of reaching this level of portability is basically zero once the patch is applied so I think it's worth doing it now. However I think I will indeed squash all the comments patch together as you suggest. Thank you! Willy
Hi Thomas, On Sun, Apr 09, 2023 at 11:28:46AM +0200, Willy Tarreau wrote: > Hi Thomas, > > On Thu, Apr 06, 2023 at 09:54:46PM +0000, Thomas Weißschuh wrote: > > This series replaces the C99 compatibility patch. (See v1 link below). > > After the discussion about support C99 and/or GNU89 I came to the > > conclusion supporting straight C89 is not very hard. > > > > Instead of validating both C99 and GNU89 in some awkward way only for > > somebody requesting true C89 support let's just do it this way. > > > > Feel free to squash all the comment syntax patches together if you > > prefer. > > I gave it some thought, at first considering that going lower than GNU89 > was possibly not very useful, but given that the changes are very small > in the end (mostly comments formating), I think that you're right. The > cost of reaching this level of portability is basically zero once the > patch is applied so I think it's worth doing it now. However I think I > will indeed squash all the comments patch together as you suggest. I've now squashed the ones about comments together, fixed the declaration inside the for statement in nolibc-test and tested with gcc 4.7 & 4.8 and confirmed it works as expected. I've queued it there for now: https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git/log/?h=20230415-nolibc-updates-4a Thank you! Willy
On 2023-04-15 16:47:03+0200, Willy Tarreau wrote: > On Sun, Apr 09, 2023 at 11:28:46AM +0200, Willy Tarreau wrote: > > On Thu, Apr 06, 2023 at 09:54:46PM +0000, Thomas Weißschuh wrote: > > > This series replaces the C99 compatibility patch. (See v1 link below). > > > After the discussion about support C99 and/or GNU89 I came to the > > > conclusion supporting straight C89 is not very hard. > > > > > > Instead of validating both C99 and GNU89 in some awkward way only for > > > somebody requesting true C89 support let's just do it this way. > > > > > > Feel free to squash all the comment syntax patches together if you > > > prefer. > > > > I gave it some thought, at first considering that going lower than GNU89 > > was possibly not very useful, but given that the changes are very small > > in the end (mostly comments formating), I think that you're right. The > > cost of reaching this level of portability is basically zero once the > > patch is applied so I think it's worth doing it now. However I think I > > will indeed squash all the comments patch together as you suggest. > > I've now squashed the ones about comments together, fixed the declaration > inside the for statement in nolibc-test and tested with gcc 4.7 & 4.8 and > confirmed it works as expected. I've queued it there for now: > > https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git/log/?h=20230415-nolibc-updates-4a Thanks! I noticed today that I did not adapt the comments in arch-s390.h; because the start() comments were already correct. But the last line of arch-s390.h still contains a C99 comment. Do you want me to send a patch or could you just push one? (Or fold it into my patch) Thanks, Thomas
On Sat, Apr 15, 2023 at 05:15:27PM +0200, Thomas Weißschuh wrote: > On 2023-04-15 16:47:03+0200, Willy Tarreau wrote: > > On Sun, Apr 09, 2023 at 11:28:46AM +0200, Willy Tarreau wrote: > > > On Thu, Apr 06, 2023 at 09:54:46PM +0000, Thomas Weißschuh wrote: > > > > This series replaces the C99 compatibility patch. (See v1 link below). > > > > After the discussion about support C99 and/or GNU89 I came to the > > > > conclusion supporting straight C89 is not very hard. > > > > > > > > Instead of validating both C99 and GNU89 in some awkward way only for > > > > somebody requesting true C89 support let's just do it this way. > > > > > > > > Feel free to squash all the comment syntax patches together if you > > > > prefer. > > > > > > I gave it some thought, at first considering that going lower than GNU89 > > > was possibly not very useful, but given that the changes are very small > > > in the end (mostly comments formating), I think that you're right. The > > > cost of reaching this level of portability is basically zero once the > > > patch is applied so I think it's worth doing it now. However I think I > > > will indeed squash all the comments patch together as you suggest. > > > > I've now squashed the ones about comments together, fixed the declaration > > inside the for statement in nolibc-test and tested with gcc 4.7 & 4.8 and > > confirmed it works as expected. I've queued it there for now: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git/log/?h=20230415-nolibc-updates-4a > > Thanks! > > I noticed today that I did not adapt the comments in arch-s390.h; > because the start() comments were already correct. > > But the last line of arch-s390.h still contains a C99 comment. ah, I must have missed it because I checked using git grep //. > Do you want me to send a patch or could you just push one? > (Or fold it into my patch) I'll do it and force-push. Thanks for checking and notifying me! Cheers, Willy