From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57093 invoked by alias); 19 Jul 2017 12:28:10 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 57082 invoked by uid 89); 19 Jul 2017 12:28:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=snap, H*f:sk:CAMZxAx, Hx-languages-length:1633, H*i:sk:CAMZxAx X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Jul 2017 12:28:08 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A769C04D2E2 for ; Wed, 19 Jul 2017 12:28:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2A769C04D2E2 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2A769C04D2E2 Received: from calimero.vinschen.de (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB6E117CFA for ; Wed, 19 Jul 2017 12:28:06 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 37CC1A80637; Wed, 19 Jul 2017 14:28:06 +0200 (CEST) Date: Wed, 19 Jul 2017 12:28:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: Importing inttypes methods from FreeBSD Message-ID: <20170719122806.GA6325@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017/txt/msg00601.txt.bz2 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1627 Hi Aditya, On Jul 19 03:09, Aditya Upadhyay wrote: > diff --git a/newlib/libc/stdlib/strtoimax.c b/newlib/libc/stdlib/strtoima= x.c > new file mode 100644 > index 000000000..0cb6e2acc > --- /dev/null > +++ b/newlib/libc/stdlib/strtoimax.c > @@ -0,0 +1,146 @@ > [...] > +intmax_t > +strtoimax_l(struct _reent *rptr, const char * __restrict nptr, char ** _= _restrict endptr, int base, > + locale_t loc) > +{ This is not quite what you want. strtoimax_l in BSD does not require a reent as first parameter. By changing the function this way, you disallow to export the function in a BSD-compatible way. Also keep in mind that it's always possible that the function name might become standarized (POSIX) at one point, just like the original GNU locale-specific functions got standarized. What you really want is to define a static function which takes the reent pointer and strtoimax_l/strtoimax only calling that, like this: --- snip --- static intmax_t _strtoimax_r(struct _reent *rptr, const char * __restrict nptr, char ** __restrict endptr, int base, locale_t loc) { [Add here all functionality you put into strtoimax_l] } intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr, int ba= se, locale_t loc) { return _strtoimax_r (_REENT, nptr, endptr, base, loc); } intmax_t strtoimax(const char * __restrict nptr, char ** __restrict endptr, int base) { return _strtoimax_r (_REENT, nptr, endptr, base, __get_current_locale ()); } --- snap --- Also, please keep the line length < 80 chars if possible. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --T4sUOijqQbZv57TR Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZb1BWAAoJEPU2Bp2uRE+garAP/iwccueUCEtY7FC8eyZ/kkjK AqCHdc4a7Buyeyp2aiyZaHguAuJqzk8ZPdPwRoW7tEzp334nEMQ2AjlJ6gpY2djc j9DhXuToBzlbygdmjCThmfn9dLxmqGuEUbj1+4WT3gQGnVsA/YcLL4c+wxU4xdP/ oudi0zAMzNtRUMKSyBFCoN+SPG79d7rzkzw112mqRc0v1T/nxXICwJ6qi00rJTFO +1+4sf9A6zviG0h65fuy0/W6GD746ck/Syahu0tq0awqxXaDsgWO5ffH/6M06z9n ooIt3T5fDdUdYwdaAJuJiupv/sz6liPP+9ino+JarlyXS0gBhK6TZIPyNFBprqUH nXH6hYd4ZJc15ujV8HRrtZEtNMw4r1qGbENTWCV9HLeBhPQFyLrn3/v631VqPp8o Ctxy6+BUY/IUh1N1r5BLACJv0UQdpgvnUYiOirFChTvdBn7Kh3RMWUFvXyberBJ6 bDHzMuguJA9HqLSTC9ChuuyojbAxvz9YlmTwvGk4uCy6Fpa53ehbVd+D3JJeBB0+ qBjUIbmplBdRImiKPrL6EKUZWxxEreTLjWeZ8dohdliswX9l0VezJ+MHzQ38M0U9 2UrwQB1lfuWct3Cj1fIs0ZZoiN620/I33bqjfTQsb8rElWMSJXN7XE6qUqqID/6Q EQN2eQfARAiRBwYNtU4g =vTFn -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--