public inbox for
 help / color / mirror / Atom feed
From: Corinna Vinschen <>
To: Stefan Tauner <>
Subject: Re: _PathLocale and __collate_load_tables()
Date: Mon, 21 Nov 2022 13:23:44 +0100	[thread overview]
Message-ID: <Y3tt0OZZtNG6B/> (raw)
In-Reply-To: <>

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.


      reply	other threads:[~2022-11-21 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  5:06 Stefan Tauner
2022-11-21 12:23 ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3tt0OZZtNG6B/ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).