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.133.124]) by sourceware.org (Postfix) with ESMTPS id 0AD1E385782B for ; Mon, 21 Nov 2022 12:23:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0AD1E385782B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669033429; 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=Gup0EHHBQw71y1c3XhU+Pt1LbKp0MaSNELctU+9TDsI=; b=RhfFMMT1WVUkD/qEFRdZnFa+L3MY++klvhwz6AgoAoyX2WOI5t0e2r+sflKBrYeTYkG6CG efT4oS5UwYnFep9eFINz1VsMkLMzt2Gx9OP6FfBhyl2azqirvXkrI/Cx9zAtIHGdzVFAcB iBzINjJQU/1UHO09yBRF3iuWnbdiG74= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-uZS6cs7vM3my503Rr6tPZQ-1; Mon, 21 Nov 2022 07:23:48 -0500 X-MC-Unique: uZS6cs7vM3my503Rr6tPZQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 05C5F3C0F223; Mon, 21 Nov 2022 12:23:48 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.219]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6C452166B26; Mon, 21 Nov 2022 12:23:47 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 9AA23A80974; Mon, 21 Nov 2022 13:23:44 +0100 (CET) Date: Mon, 21 Nov 2022 13:23:44 +0100 From: Corinna Vinschen To: Stefan Tauner Cc: newlib@sourceware.org Subject: Re: _PathLocale and __collate_load_tables() Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Stefan Tauner , newlib@sourceware.org References: <1MqJqN-1pHDqH0zJb-00nNxF@mail.gmx.net> MIME-Version: 1.0 In-Reply-To: <1MqJqN-1pHDqH0zJb-00nNxF@mail.gmx.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 Nov 18 06:06, Stefan Tauner wrote: > Hi, > > there is a char *_PathLocale = NULL; in ./newlib/libc/locale/locale.c > that is only read in __collate_load_tables() > in ./newlib/libc/posix/collate.c > I have looked at the git history and even googled but I couldn't figure > out at all what the variable is supposed to be used for. Half of > __collate_load_tables() would be unreachable if _PathLocale is never > non-null. And then I looked at where __collate_load_tables() is used... > and it seems to be not used within the library itself at all, and from > the __ prefix I'd assume it's not really meant to be used externally > (although it has a prototype in collate.h). > > Is this all just dead code or what am I missing? :) Yes, it's basically dead code. Orignally this code was added for some reason to support locales in a minmial BSD-like way, but has never been really used apart from minimal LC_CTYPE and LC_MESSAGE handling for the "C" locale. If it was meant to have a future at one point and what this future would have entailed, isn't clear to me. A couple of years ago I added Cygwin-specific code to allow locale handling by using internal Windows functionality, but I left the rest of the code intact, so as not to break something if somebody would take a stab at it for non-Cygwin targets. I have a vague recollection that I inspected the code once, and found that it was unsuable for some reason and needs a resolute helping hand. Corinna