From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12327 invoked by alias); 29 Jul 2017 12:40:50 -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 12314 invoked by uid 89); 29 Jul 2017 12:40:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=nonreentrant, tandem, POSIX_SOURCE, strtol X-HELO: mail-vk0-f43.google.com Received: from mail-vk0-f43.google.com (HELO mail-vk0-f43.google.com) (209.85.213.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Jul 2017 12:40:47 +0000 Received: by mail-vk0-f43.google.com with SMTP id d124so3757580vkf.2 for ; Sat, 29 Jul 2017 05:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ncJVAGxag4Mngh5B6yOrT8eEay4qcbbH8wtXkWG0uZA=; b=o7rU0Ij1nztCOaTXXUJ1Te8Nv43pO794dounTcVa9Tf6Tn0r//m+Qm5puBp8pqcTiD dE/fo+QWbGSNlDHZD1XTQeKZTIOjlbr8uSSX7MV8qvfGogrf6mm/LH7SICR8utH92LFI 9yMsLegJZ9Jlrj+EW1OmiVufnmpBpqpuxtHo/QeRIs93hTgoT1yLL6tkubH6S2Zw2nKm Ngknj7OES4R0rHKxlCU23Txj8kjrzIz2V7VzXKWW/RFeqhGhLlqRvHZhigOTPr7TugQD UzJIfcSF94CL7iPBSeC6ctjJOfSC1TFHKL2jiNJnPi/htL0jAN23JTEEW8jSAdLSOVAf sg9w== X-Gm-Message-State: AIVw111n6fjfs/uiqdJ07nVNgizllM3mvx7qc8f7Ji1k2UCbrI/fXxuN xLsbYHdNzAkZ3yVEcBv4gZqG4+XjsJH9 X-Received: by 10.31.33.80 with SMTP id h77mr5605688vkh.11.1501332045808; Sat, 29 Jul 2017 05:40:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.59.29 with HTTP; Sat, 29 Jul 2017 05:40:44 -0700 (PDT) In-Reply-To: <20170728182942.GE24013@calimero.vinschen.de> References: <20170726110849.GG14419@calimero.vinschen.de> <20170727123207.GB27695@calimero.vinschen.de> <20170728104304.GA24013@calimero.vinschen.de> <20170728130803.GD24013@calimero.vinschen.de> <20170728182942.GE24013@calimero.vinschen.de> From: Gedare Bloom Date: Sat, 29 Jul 2017 12:40:00 -0000 Message-ID: Subject: Re: Importing inttypes methods To: "newlib@sourceware.org" Cc: aditya upadhyay Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00696.txt.bz2 On Fri, Jul 28, 2017 at 2:29 PM, Corinna Vinschen wrote: > On Jul 28 10:28, Gedare Bloom wrote: >> On Fri, Jul 28, 2017 at 9:08 AM, Corinna Vinschen wrote: >> > On Jul 28 07:40, Gedare Bloom wrote: >> >> Corinna, good catch. I mentioned this issue to Joel but it dropped out >> >> the bottom some how. Is it only (for example) the strtoimax_l() that >> >> needs to be guarded, or also the _strtoimax_l? (I suspect only the >> >> strtoimax_l, but want to be clear before the next round of patches >> >> lands here.) >> > >> > The reentrant prototypes use locale_t, so they depend on including >> > xlocale.h, too. It's a bit uncommon but the simplest solution. >> > >> Since the non-reentrant version (e.g., strtoimax) wraps the re-entrant >> one, then there is no support unless locale is available. Would it be >> better to have a non-reentrant, nonolocale implementation in tandem >> with the reentrant one, or do we not worry about it and don't support >> these functions at all unless the POSIX_SOURCE is set properly and >> BSD_VISIBLE? > > Good catch on your side, I really had to look it up now. Here's how it > is in the other, similar cases like strtol: > > There are actually four functions: > > strtol > strtol_l > _strtol_r > _strtol_l > > _strtol_l is the internal implementation and *static*. _strtol_r > is the exported reentrant function and consequentially not having > the locale_t parameter. > > So, why not just keep it at that for now with strtoimax, etc? It only > requires minimal changes and nobody using the reentrant functions > actually asked for a reentrant function with thread-local locale > parameter yet :} > > As a result, the guards for the exported reentrant functions are not > required. > OK. Aditya please pursue this direction for implementation. It will take a bit more refactoring to get it right. > > Corinna > > -- > Corinna Vinschen > Cygwin Maintainer > Red Hat