From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 27392385841A for ; Tue, 23 Jan 2024 16:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27392385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 27392385841A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706025922; cv=none; b=GPhaiqVfwdz61NBNVnMnVBmg5/2eoWMvyLvrJvzausUl0fti3ySWs0QDC7yQRmReWicjGEUlltZUg/stPLw8TIrM/abAMoHCN/A4WGP1Z1oMT8XFAzuXa0FzzJAef6d5eUo+f4bnBDrSmRJfqXy+0PpzU86wcDnZe2XcQGS7dm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706025922; c=relaxed/simple; bh=2G7ZxwBaaNzypS/3uu3nlz1w1icG0ORYnyPlgCX288o=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=jaZhaRPIohoP5FRAEDw/ivruNIooZU3PkMnLTq2EkD5/SFiBiZolMIIByxOCDPrVRPiM51rzlv1tqGFiBrG9iK/HZzCTH0tQT0x810GyjLHnvkT5Pr/trv2uYGNSL5qMyVawVatet1a3RjhqTXaoVK0rw0jJKIjVvUmzYM5fU20= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40ea5653f6bso41612205e9.3 for ; Tue, 23 Jan 2024 08:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706025916; x=1706630716; darn=sourceware.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=mnJUdN+1mVC0jfDAX9x561T2Hd0XUgy1MYasIh8dhq0=; b=TV9K0EK0mrlEnrJutsyVIeyCkUUbB04AezlB9eG9oODzkyF81fpG9Z4rhyqsUksrkE Evxl4jGLNePJLEy1CB//d1Sb7ipQ0/6EohSxDAo/+1iyk9PlTvPQOTLKdPRya0yAV5Kj uGJB9V0hOgE8xoKi5+wMhzxzOd82c7srCcKRIs+eF9dH1bmzcBdmCgKTbmC08Re+80hV qRYah3LSS+t9hO+g0GiRx3ODYohWMVejiZ3qB28QIKIsRJcMGQm2dFWZA9J2ofhu/LND 1kVCQKDLlK10Oj5Cp6ovszDk4DLIYSZWzuvWjsWWX2YDHtbtOUido9X5xgfZVgcCRum4 6RFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706025916; x=1706630716; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mnJUdN+1mVC0jfDAX9x561T2Hd0XUgy1MYasIh8dhq0=; b=Gm2+3jWojl77/qIQj8ev90AUBttfhOM8etpzYCkk0JlRrP7chKc7nvbUvKlD7suuCu DYma6n5DUfjOEa2DrLUKdPrGYe+AhSfjLiuNaoUaz8bjllUYQoi/JC7d5WFdluRLbMVO Rjmk2L8Cdki7ZW3KuANweKkz7vTlYCKymjNMB/WJscbkjw0T9LR/JhfWgm2yqyrA+A4r ZtHZfxlWCCHed3uQalKBL2AwMyREkBVbu3YEM2lvaqV5cJTNXI9lZRFGu7c9u/VAyx0g Js8E6hf8VvSbo6NKgv4pIcKsQ5D3heM8vWlAYPzMkQV8RX+6XVm8tfzB8Wy5AeNiKpm0 dfpQ== X-Gm-Message-State: AOJu0YyshA0VJxOv0Dse1H5M0K4aNBgVrR/TctFq0kWt++sTrmp6VXLJ 0hC45S1uoVZ1lu0bbMy/yJpipot2/Bba0vy4r8poNckvpJedL5PWWeFNsqw5G2v4izQ203iUZ67 qb1j8QjvnO2KbHyYIhVIpAFxoiaWJE56lmQ== X-Google-Smtp-Source: AGHT+IESWubfGSWv43L9x+Ch2zU+luHoJUpy+vQeBX3tQKTyaIKXa+pZTzJFuCVwgNvmfoaJwf1ChH7mX1DE2L6EHOc= X-Received: by 2002:a05:600c:4c8a:b0:40e:509c:36ec with SMTP id g10-20020a05600c4c8a00b0040e509c36ecmr274718wmp.206.1706025916386; Tue, 23 Jan 2024 08:05:16 -0800 (PST) MIME-Version: 1.0 References: <83962310-aec8-a718-bafb-6e10703693b8@t-online.de> In-Reply-To: From: C Howland Date: Tue, 23 Jan 2024 11:05:05 -0500 Message-ID: Subject: Re: Fw: Hide non-standard itoa/utoa() in stdlib.h or drop these functions? To: newlib@sourceware.org Content-Type: multipart/alternative; boundary="000000000000b953cf060f9f1ce0" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: --000000000000b953cf060f9f1ce0 Content-Type: text/plain; charset="UTF-8" > > ------------------------------ > *From:* Corinna Vinschen > *Sent:* Tuesday, January 23, 2024 4:03 AM > *To:* Christian Franke > *Cc:* newlib@sourceware.org > *Subject:* Re: Hide non-standard itoa/utoa() in stdlib.h or drop these > functions? > > > 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 > > itoa() and utoa() should definitely be deleted. Removing them from the header file is only a half-baked solution for regular Newlib because they are still in the library. With them still in the library you can end up linking to the wrong version and that's worse than the "wrong" prototype being found that clearly blows up compilation. Given the __ versions still being available it allows a simple fix for anyone that does happen to use them. (Perhaps to be most friendly to that we should somehow make sure that a point in the next release notes mentions this. (Won't be bad to find with the __ versions still in stdlib.h, though.)) (In hindsight we probably fell down on the job allowing them to be added as they were. Just the __ versions should have gone in to begin with.) Craig --000000000000b953cf060f9f1ce0--