Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp135530rwl; Tue, 28 Mar 2023 22:37:47 -0700 (PDT) X-Google-Smtp-Source: AKy350aGSaWDVGbGU+PqBUz8W84hOrJRmHfhELgz+hcP0Gw0SoDOHqqlFEZnzYCMeD6cBmYdhFzx X-Received: by 2002:a17:907:1df0:b0:8aa:33c4:87d5 with SMTP id og48-20020a1709071df000b008aa33c487d5mr307354ejc.10.1680068267532; Tue, 28 Mar 2023 22:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680068267; cv=none; d=google.com; s=arc-20160816; b=pL5/cjo9v8QRll2duaM9+Olx+IP6fdXdUg91NeHIwYce/jp+AUOERq/vF+Yu/K4SjI nQu6pPoORce9IcVqF917qXQRdro/GBsAImvZjjQ+YLBstEoreMi/uXuXOlJTNVo8pF4K z+KMdXORnguUYXQipqmWrX0s9Kq4NmCTyPE/tXwIgvP+1FAYBifg7FU4thddCEi65FC0 vtcYlfiDUJO6sGSWBDclIpWBEvqQlidKrSg2KckWN8l2ydZTNlYtjeDL/X57gdXH8LCp Ot1vdAvkAGfOhZv5lugEAmPTWEz2MGDrRtMd8/w9yw384Z9AGPLw97lyZ/yPpbXTwrdi 6/cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=xY/nEnbJNkXy+AW198GxEqtJ8AKORWqvhtO4Tx1tts4=; b=S/0g/XP4VNrvLixhFspCSP20dSvAX/TkNTwwAQ1goxMHTHsy3zxwwbnSKPlWbP2y8K jEuHV6cXLDZclO3YhCgYFTF8gq3SXZnbLFM0IM/IHP9K1E2abZqumd202C4Ui+PgVqJw sTd5lvY3SnZUhwgahkXbyyt2812w8ydntuwzYB1zZODKFfKJzH865J559D62V/BANwS5 lOl/4tttSMKYV1hXbZSqs+ZeSmUSzRcjKvehpS46IK9myWVNIUSsfR2kFR1lSQut8dzB 2AViYnrBe5durlAmMUur5YJCWcSH5uOz8tFGL/iUGf+q8xXaJ5ijIBwrNjWqVmAGpUBH x33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=HR7Vy4jr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dx26-20020a170906a85a00b009205fe06a7dsi31040940ejb.576.2023.03.28.22.37.21; Tue, 28 Mar 2023 22:37:47 -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=HR7Vy4jr; 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 S229734AbjC2Ffr (ORCPT + 99 others); Wed, 29 Mar 2023 01:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbjC2Ffh (ORCPT ); Wed, 29 Mar 2023 01:35:37 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4266E3A84; Tue, 28 Mar 2023 22:35:36 -0700 (PDT) Date: Wed, 29 Mar 2023 05:35:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1680068134; bh=GLQ3ltzyMx0gEOf9aVkp+vIB25DqgxrGs7yglPKYW7Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HR7Vy4jrr/Ewm325u3lgPSy2P/C4EjKjgUD4N8yZwauhSiD4T9KlCW5lqYgzWcPBS cDi766OmwN53F369TuXd1C5l7Npqwpr2aE5ekLt9E8UDJXXZ1E7utgP0i5pozVAa7r RbMgwkDmpV9K4kqOCKJKBf6zB9D52FL9xs70aqrI= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] tools/nolibc: validate C99 compatibility Message-ID: <2be5dd3f-d4ca-499a-9f7e-3113b4f04412@t-8ch.de> References: <20230328-nolibc-c99-v1-1-a8302fb19f19@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Willy, On 2023-03-29 07:16:11+0200, Willy Tarreau wrote: > On Tue, Mar 28, 2023 at 09:07:35PM +0000, Thomas Weißschuh wrote: > > Most of the code was migrated to C99-conformant __asm__ statements > > before. It seems string.h was missed. > > > > Fix string.h and also validate during build that nolibc stays within > > C99. > > I'm all for improving portability, however I have a concern with building > the test case with -std=c99 which is that it might hide some c99-only > stuff that we'd introduce by accident in the nolibc's code, and I'd > rather not do that because it will mean changing build options for some > external programs using it if it happens. However I totally agree with > you that we need to make sure that there's no build issues with c99 > compilers. Modern compilers are c99-compatible but generally come with > GNU extensions and I understand why you're interested in switching to > std=c99 in order to drop some of these like "asm". Should we have two > build targets, the default one and a c99 one ? Maybe. The build is so > small and quick that nobody will care, so we could definitely imagine > building the two versions. Maybe you have a better idea ? I'm not sure I understand. Do you want to stay compatible with c89/gnu89? If so we could use that baseline standard instead of -std=c99. Without specifying a standard we get whatever the compiler uses as default which is probably much newer than c99. Having two targets seems to be easy to do but I'm not sure what the advantage would be over compiling once against the intended baseline standard. Regards, Thomas