From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CF44D38582AC for ; Tue, 23 Jan 2024 09:03:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF44D38582AC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF44D38582AC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706000605; cv=none; b=jNwC6SdjV18Ci0FRRuhP9LY3wU+48GU2kPBCLcKfj/Wkv6m5sdE/e9NSvy09Z1zX+kJv6eF8ZN91Q32BfA34p11QJGkXVCAeLBT5qCS2HTAvZSIbxIBruvlxxmL0mD0obwEGI72x9z17ul8uuP5sStrnr2usL/ifGpad+m8rrrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706000605; c=relaxed/simple; bh=N2Iy1BMlqoxzrI0TRTU7d3nKjjCid8bkFNOxwgE6/Z0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=OgIpwbP8/vugeCHkw5mTt9pnWHXCOJbQQRr40DskZTjJ75S0wNxX/QTTzIDhHkAF+U9cGFOqwXCahKNr3oRdY7VKsDYneq8omcH/snujrJCTUmVQ1ILqb6YEXpg5IXPFupp72wvqbRrOh+2ampod+TYgShpf+igO1rERi8/G/iM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706000602; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=bbPece3+R9e4WC9jakZux8NBXrw1ayaOJ/Lj/b+Vdo0=; b=La2U3TnWrRyz68slQmykT/jSMl7J7ndOlvie2PNoel2meLGnh6lYvjiTDCJ+AoG/oAEfTZ Ys8Nq2+GQzYM5B/VGS1mvUL8Zuwx05MnoH0kwUZBdyS7agYa4hehAbA4adFbxwVEkEFARG W+Bd71e6+nPXyfXv0itX0ltaoh9OmJM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-7PRc3PcdNw-Z3AhsMQR-Qg-1; Tue, 23 Jan 2024 04:03:20 -0500 X-MC-Unique: 7PRc3PcdNw-Z3AhsMQR-Qg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93E46837229; Tue, 23 Jan 2024 09:03:20 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 592F53C2E; Tue, 23 Jan 2024 09:03:20 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 29E59A80890; Tue, 23 Jan 2024 10:03:19 +0100 (CET) Date: Tue, 23 Jan 2024 10:03:19 +0100 From: Corinna Vinschen To: Christian Franke Cc: newlib@sourceware.org Subject: Re: Hide non-standard itoa/utoa() in stdlib.h or drop these functions? Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Christian Franke , newlib@sourceware.org References: <83962310-aec8-a718-bafb-6e10703693b8@t-online.de> MIME-Version: 1.0 In-Reply-To: <83962310-aec8-a718-bafb-6e10703693b8@t-online.de> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,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 server2.sourceware.org List-Id: On Jan 22 19:46, Christian Franke wrote: > The functions itoa() and utoa() are non-standard, not exported by Cygwin and > also unavailable on FreeBSD and Linux (glibc and musl libc). Busybox for > example could not be build OOTB using newlib's stdlib.h because there are > conflicts with local functions with same names but different signatures. > > See the original posts on the Cygwin list for more details: > https://sourceware.org/pipermail/cygwin/2024-January/255216.html > https://sourceware.org/pipermail/cygwin/2024-January/255217.html > > Corinna proposed to either drop these functions entirely or hide the > prototypes on Cygwin only. I attached a patch for the second alternative. > > -- > Regards, > Christian > > From 5f1c43796c6a125f04c1f2436fc1048783ce3b7a Mon Sep 17 00:00:00 2001 > From: Christian Franke > Date: Mon, 22 Jan 2024 19:11:20 +0100 > Subject: [PATCH] Hide itoa, utoa, __itoa and __utoa in stdlib.h on Cygwin only > > These functions are non-standard and not exported by Cygwin. > > Signed-off-by: Christian Franke > --- > newlib/libc/include/stdlib.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h > index 15b349440..fd89f5ba7 100644 > --- a/newlib/libc/include/stdlib.h > +++ b/newlib/libc/include/stdlib.h > @@ -221,11 +221,13 @@ char * ecvtbuf (double, int, int*, int*, char *); > char * fcvtbuf (double, int, int*, int*, char *); > char * ecvtf (float,int,int *,int *); > #endif > +#ifndef __CYGWIN__ > char * __itoa (int, char *, int); > char * __utoa (unsigned, char *, int); > -#if __MISC_VISIBLE > +# if __MISC_VISIBLE > char * itoa (int, char *, int); > char * utoa (unsigned, char *, int); > +# endif > #endif > #if __POSIX_VISIBLE > int rand_r (unsigned *__seed); > -- > 2.43.0 > In fact, while this patch fixes the namespace pollution for Cygwin, I wonder if we shouldn't remove itoa/utoa entirely. The underscored functions __itoa/__utoa accomplish exactly the same thing. Does anybody actually *need* itoa/utoa as long as we have __itoa/__utoa? Corinna