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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 13213398C815 for ; Fri, 22 Jan 2021 11:12:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 13213398C815 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-WKeMuKpRNSqeSZbivtR5FQ-1; Fri, 22 Jan 2021 06:12:45 -0500 X-MC-Unique: WKeMuKpRNSqeSZbivtR5FQ-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F782801F9B; Fri, 22 Jan 2021 11:12:42 +0000 (UTC) Received: from localhost (unknown [10.33.36.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01B2860855; Fri, 22 Jan 2021 11:12:41 +0000 (UTC) Date: Fri, 22 Jan 2021 11:12:41 +0000 From: Jonathan Wakely To: "CHIGOT, CLEMENT" Cc: Rainer Orth , libstdc++ , David Edelsohn via Gcc-patches , David Edelsohn Subject: Re: [PATCH] libstdc++: implement locale support for AIX Message-ID: <20210122111241.GH541588@redhat.com> References: MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2021 11:12:51 -0000 On 22/01/21 09:57 +0000, CHIGOT, CLEMENT via Libstdc++ wrote: >Hi Rainer > >> > 3) POSIX 2017 and non-POSIX functions >> > Many of the *_l functions being used in GNU or dragonfly models aren't >> > POSIX 2008, but mainly POSIX 2017 or like strtof_l not POSIX at all. >> > However, there are really useful in the code, thus I've made a double >> > implementation based on "#ifdef HAVE_". Is it ok for you ? It's not really >> > POSIX 2008 but more POSIX 2008 with 2017 compatibility. >> > For the configure, I didn't find any better way to check each syscall, as >> > they all depend on different includes. Tell me if you have a better idea. >> >> First a general observation: there are two groups of functions you're >> testing for: >> >> * Pure BSD additions, not available in either POSIX.1, ISO C, or glibc: >> >> localeconv_l >> mbstowcs_l >> strtod_l >> strtof_l >> strtold_l >> wcsftime_l >> >> * Part of XPG7: >> >> iswctype_l >> strcoll_l >> strftime_l >> strxfrm_l >> towlower_l >> towupper_l >> wcscoll_l >> wcsxfrm_l >> wctype_l >> >> My suggestion would be not to have configure tests _GLIBCXX_HAVE_ >> for any of the second group at all: this is ieee_1003.1-2008, after all, >> so if some OS selects that clocale variant, it better implement all of >> those. If really need be, one could a configure check for those and >> error out if any is missing. This makes the code way more readable than >> trying to handle some hypothetical partial implementation. > >In this case, it would be better to call it ieee_1003.1-2017 but I agree >it would be better to avoid all these #ifdef. Yes, 2017 is the current standard (equivalent to 2008 plus corrigenda), but we could also use a shorter, easier to remember name, like posix.1-2017, xpg7, or susv4 (or even accept all four and make them mean the same thing, though that will probably cause confusion). >Some are still needed as for example only the last version of AIX have >strftime_l. > >> As for the BSD group, I suggest to have one representative configure >> test (for localeconv_l perhaps) and then use an appropriate name for the >> group as a whole. Again, this will most likely be an all-or-nothing >> thing. > >I'm not sure this is really all-or-nothing for these. Maybe strtof_l and cie >can be grouped by. But the 3 others are really different. Linux have wcsftime_l >but not the others. AIX avec none. BSD have all. Glibc has strto{f,d,ld,l,ul,ll,ull}_l too: See https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/stdlib.h;h=6360845d98e6e1c3f42821def14312dc2279d74c;hb=HEAD#l268