Hi Collin,
> I pushed this one line patch to update a comment that was written before
> localename-unsafe.c existed.
Thanks!
ibc-alpha/bd1c3df2b8aaaeaf6199e715212db67d2b80266f.1748980203.git.collin.fu...@gmail.com/T/#u
>From 61c4a6ae9ebdbabdfdcc0175b6f467419bada300 Mon Sep 17 00:00:00 2001
Message-ID: <61c4a6ae9ebdbabdfdcc0175b6f467419bada300.1748980594.git.collin.fu...@gmail.com>
From: Collin Funk
Date:
e-Required
configure.ac:38: gl_INIT is expanded from...
configure.ac:957: the top level
This patch fixes it.
2025-03-21 Bruno Haible
setlocale-null: Fix autoconf warning.
* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Define through
AC_DEFUN_ONCE.
diff
This patch extracts the base of the Windows LC_MESSAGES workaround into
a separate module 'setlocale-messages', so that the module 'getlocalename_l'
can depend on it without using the (large) 'setlocale' module.
2025-02-21 Bruno Haible
setlocale-messa
A gnulib implementation of the POSIX:2024 function getlocalename_l will likely
depend on or require code from lib/setlocale.c. Since I want that module to be
under LGPLv2+, 'setlocale' needs to be under LGPLv2+ as well. I can do this
relicensing, since I am the only author of copyrigh
I'm not sure how many people use a Galician or Tamil locale on macOS. But
anyway:
2025-02-12 Bruno Haible
setlocale: Update info about Galician and Tamil.
* lib/setlocale.c (locales_with_principal_territory): Galician is
mostly spoken in Spain, not Portugal. Tam
On native Windows, LC_MESSAGES does not exist in ; Gnulib adds
a definition of it. Accordingly, setlocale() needs to be taught to handle
the LC_MESSAGES category as part of LC_ALL. The code for doing this was
incomplete.
The first of these patches fixes it. The second patch adds a unit test
When a program calls setlocale() with some argument that is not reflected in
the environment variables, ideally the gl_locale_name function should return
that locale.
Currently this is enabled only for glibc systems. But it is actually possible
to do the same thing on some other platforms as well
the gnulib code that tests
HAVE_PTHREAD_API. Since the ability to build a library without dependency
on -lpthread can be seen as a useful feature, I'm implementing it here.
2023-11-17 Bruno Haible
mbrtowc, mbrtoc32, nl_langinfo, setlocale-null: Obey --disable-threads.
Repor
Turkey has renamed itself, see
https://edition.cnn.com/2022/06/02/europe/turkey-trkiye-united-nations-scli-intl/index.html
2022-06-03 Bruno Haible
setlocale: Update after Turkey changed its name.
* lib/setlocale.c: Update comments.
diff --git a/lib/setlocale.c b/lib
Reuben Thomas asked:
> I'm interested in why you suspect MSYS would be worse than mingw? Is it
> because it is not as widely used as mingw
That is one factor. The other one is that they welcome changes that are
buggy in the long run, such as
- in MSYS1, the argv[] processing in the middle of the
On Mon, 2 May 2022 at 01:05, Bruno Haible wrote:
>
> We have documented hundreds of deficiencies of mingw [1] w.r.t. the POSIX
> standard. MSYS is surely worse, not better, than mingw. I recommend to use
> the respective modules, for those POSIX APIs that you use.
>
I'm happy to decide that on a
Reuben Thomas wrote:
> > In the end I tried something a bit different, which was to reduce the
> > > number of gnulib modules I was using, as for the code I'm writing it
> > > seemed
> > > reasonable to assume C99 and POSIX.1-2008.
> >
> > ?? That makes no sense to me. Either you want to assume PO
On Sun, 1 May 2022 at 22:34, Bruno Haible wrote:
> Reuben Thomas wrote:
> > It's not really that I'm doing anything: gnulib seems to detect MSYS as
> > being a POSIX platform.
>
> Not really; something in the configure step (which you haven't shown)
> made it "detect" some POSIX threads facility.
Reuben Thomas wrote:
> It's not really that I'm doing anything: gnulib seems to detect MSYS as
> being a POSIX platform.
Not really; something in the configure step (which you haven't shown)
made it "detect" some POSIX threads facility.
> In the end I tried something a bit different, which was to
On Sat, 30 Apr 2022 at 12:44, Bruno Haible wrote:
> Reuben Thomas wrote:
> > on MSYS it goes wrong
> > ...
> > setlocale_null_with_lock (category=category@entry=0, buf=buf@entry
> =0xbd80
> > "", bufsize=bufsize@entry=3221) at setlocale_null.c:228
> > 228 if (pthread_in_use())
> > (gdb)
Reuben Thomas wrote:
> on MSYS it goes wrong
> ...
> setlocale_null_with_lock (category=category@entry=0, buf=buf@entry=0xbd80
> "", bufsize=bufsize@entry=3221) at setlocale_null.c:228
> 228 if (pthread_in_use())
> (gdb)
> 230 pthread_mutex_t *lock = gl_get_setlocale_null_lock (
It works fine on mingw32 and mingw64, but on MSYS it goes wrong when
calling pthread_mutex_lock. In the following gdb session, the first line is
from my code; the rest is tracing through gnulib code.
(gdb) n
171 char *old_locale = setlocale(LC_ALL, NULL);
(gdb) s
rpl_setlocale (category=0
insertions(+)
diff --git a/ChangeLog b/ChangeLog
index d46bfbb1a..de92d102e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2020-11-21 Paul Eggert
+ setlocale-null-tests: work around GCC bug 44511
+ * tests/test-setlocale_null-mt-all.c:
+ * tests/test-setlocale_null-mt
printf.lo setlocale.lo setlocale-lock.lo
setlocale_null.lo version.lo xsize.lo osdep.lo intl-compat.lo windows-mutex.lo
windows-rwlock.lo windows-recmutex.lo windows-once.lo libintl.res.lo
libtool: link: dumpbin -symbols .libs/bindtextdom.obj .libs/dcgettext.obj
.libs/dgettext.obj .libs/gettext
On 2019-12-18 I wrote:
> Use of setlocale(), with the gnulib override, now requires linking
> with $(LIB_SETLOCALE) - to avoid link errors on AIX.
I see such a link error on AIX:
xlC -q64 -qthreaded -qtls -DHAVE_CONFIG_H -I. -I../../gltests -I..
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_T
Another tweak of this module: Add the ability to rely on the lock defined
in another library. This makes it possible to avoid a link error regarding
libgettextpo and libintl on Windows.
2019-12-24 Bruno Haible
setlocale-null: Make it easy to rely on the lock in another library
This patch ensures that the gl_get_setlocale_null_lock function gets
exported from shared libraries (such as libintl.so) also on ELF systems,
so that different shared libraries attached to the same process use the
same lock.
2019-12-23 Bruno Haible
setlocale-null: Export the lock
While for most package, it is a convenience to have the setlocale_null
function declared in , for gettext's libintl it's better to
have it declared in a separate header file - because libintl does not use
the gnulib-overridden locale.h file.
2019-12-22 Bruno Haible
setl
> * modules/setlocale-tests (Makefile.am): Link the test programs with
> $(LIB_SETLOCALE).
> ...
> * modules/nl_langinfo-tests (Makefile.am): Likewise.
I missed one test program that also calls setlocale().
2019-12-21 Bruno Haible
nl_langinfo tests: Fi
Part of this new code in setlocale.c would also be useful for localename.c.
I'm therefore moving it to module 'setlocale-null'. At the same time, I'm
renaming the function setlocale_null to setlocale_null_r (in analogy with
getlogin_r, ttyname_r, ptsname_r).
2019
This patch makes use of the 'setlocale-null' module, to make the
setlocale(..., NULL) calls multithread-safe.
Use of setlocale(), with the gnulib override, now requires linking
with $(LIB_SETLOCALE) - to avoid link errors on AIX.
Although we now have two modules 'setlocale-null&
setlocale (category, NULL)_can return NULL in two situations:
- when the category argument is invalid, or
- on Android (tested on Android 4.3).
2019-12-18 Bruno Haible
setlocale-null: Handle NULL result from setlocale.
* lib/locale.in.h (setlocale_null): Document EINVAL
This patch removes the need to link with -lpthread on several platforms,
by using the "weak symbols" trick from lock.h. With this, the only platform
on which setlocale-null requires -lpthread is AIX.
2019-12-16 Bruno Haible
setlocale-null: Remove need for -lpthread on musl
It is the usual expectation that use of setlocale() to change the global
locale is not multithread-safe (of course), but that setlocale(...,NULL)
to query the name of the global locale is.
However, POSIX does not guarantee it:
<https://pubs.opengroup.org/onlinepubs/9699919799/functi
has code to pull it in, in the gt_INTL_MACOSX macro.
Yes.
> However, gt_INTL_MACOSX is only invoked in the m4/gettext.m4 file, in
> AM_GNU_GETTEXT, not from gl_FUNC_SETLOCALE in m4/setlocale.m4.
gt_INTL_MACOSX is also required by gl_LOCALENAME in m4/localename.m4,
part of module 'loc
4 file, in
AM_GNU_GETTEXT, not from gl_FUNC_SETLOCALE in m4/setlocale.m4. This
autoconf code seems to be assuming that the CoreFoundation linkage is
only needed if you're using the gettext gnulib module in addition to the
setlocale module, or that it's a prereq. But GNU Octave is (s
On macOS, the setlocale override that I added produces warnings such as
Warning: Failed to set locale category LC_NUMERIC to fr_DE.
Warning: Failed to set locale category LC_TIME to fr_DE.
Warning: Failed to set locale category LC_COLLATE to fr_DE.
Warning: Failed to set locale category
/test-localename.c:103: assertion 'ret != NULL' failed
FAIL test-localename (exit status: 139)
The cause is that the native setlocale() function always fails.
(See
<https://android.googlesource.com/platform/bionic/+/29c7f0b4d18f812267c2194b85204e19e41d0387>.)
This patch provides a wor
The last platform which lacked setlocale() was probably SunOS 4.
2019-01-06 Bruno Haible
localename: Assume setlocale function.
* lib/localename.c (gl_locale_name_posix): Assume setlocale exists.
* m4/localename.m4 (gl_LOCALENAME): Don't test whether setlocale e
Committed in both gettext and gnulib:
2018-09-15 Bruno Haible
setlocale: Improve support for locales not supported by libc.
Reported by Dapeng Gao at
<https://savannah.gnu.org/bugs/?54479>.
* gettext-runtime/intl/setlocale.c: I
test-mbrtowc5.sh fails on native Windows: The mingw or MSVC setlocale()
understands the special locale name "C", but not the special locale name
"POSIX". This fixes it.
2017-04-21 Bruno Haible
Fix test-mbrtowc5.sh failure on native Windows.
* doc/posix-functions/setlocale.texi: Mention setlocale(LC_ALL,"")
never fails, and the need to check categories individually.
---
ChangeLog | 6 ++
doc/posix-functions/setlocale.texi | 8
2 files changed, 14 insertions(+)
diff --git a/ChangeLog b
On Solaris 11 2011-11, I see a test failure:
Turkish_Turkey.65001: unknown locale
setlocale did not fail for explicit (NULL)
FAIL: test-setlocale2.sh
The reason is that /bin/sh does not like to set LC_ALL to some values:
$ /bin/sh -c 'LC_ALL=Turkish_Turkey.65001 pwd'
Turkish_Tu
On Cygwin 1.5.25, I'm seeing this test failure:
setlocale did not fail for implicit ar_SA.ISO-8859-1
FAIL: test-setlocale2.sh
This fixes it.
2011-06-04 Bruno Haible
setlocale: Enable replacement on Cygwin 1.5.
* m4/setlocale.m4 (gl_FUNC_SETLOCALE): Set REPLACE_SETL
On 02/17/2011 08:23 PM, Bruno Haible wrote:
>
> Huh? This is surprising. And what does this program show?
>
> #include
> #include
> #include
> #include
>
> int
> main ()
> {
> setenv ("LC_ALL", "ar_SA.ISO-8859-1", 1);
> if (se
Eric Blake wrote:
> > #include
> > #include
> > #include
> > #include
> >
> > int
> > main ()
> > {
> > if (setlocale (LC_ALL, "ar_SA.ISO-8859-1") != NULL)
> > {
> > printf ("%s\n
On 02/17/2011 07:40 PM, Bruno Haible wrote:
> Hi Eric,
>
>> I'm now seeing this failure on Haiku alpha 2:
>>
>> FAIL: test-setlocale2.sh (exit: 1)
>> ======
>>
>> setlocale did not fail for implicit ar_SA.ISO-8859-1
&g
Hi Eric,
> I'm now seeing this failure on Haiku alpha 2:
>
> FAIL: test-setlocale2.sh (exit: 1)
> ======
>
> setlocale did not fail for implicit ar_SA.ISO-8859-1
>
> What can I do to help you diagnose the root cause and work around thi
On 02/12/2011 10:21 AM, Bruno Haible wrote:
>> I'm therefore taking the code from gettext. It provides a workaround against
>> the problems 1 and 3.
>
> And here's the fix for problem 2.
>
>
> 2011-02-11 Bruno Haible
>
> setlocale: W
Now it's OK to use this new module in the tests. I'm applying this.
Unfortunately, this does not fix the 13 test failures on mingw; still need to
investigate.
2011-02-12 Bruno Haible
Avoid setlocale bugs in tests.
* modules/btowc (Dependencies): Add
> I'm therefore taking the code from gettext. It provides a workaround against
> the problems 1 and 3.
And here's the fix for problem 2.
2011-02-11 Bruno Haible
setlocale: Workaround native Windows bug.
* lib/setlocale.c (rpl_setlocale): On native Windows
> The major problem on mingw is that setlocale(LC_ALL,"") does not look at the
> environment variables. On POSIX systems it does, but on mingw it doesn't.
>
> The second problem is the detection whether setlocale succeeded: When passed
> a string with suppo
Ben Pfaff <[EMAIL PROTECTED]> writes:
> Bruno Haible <[EMAIL PROTECTED]> writes:
>
>> Simon Josefsson wrote:
>>> Why can we assume setlocale exists?
>>> Is it POSIX?
>>
>> Even more: It's specified by ISO C 99.
>
> Even more than
Bruno Haible <[EMAIL PROTECTED]> writes:
> Simon Josefsson wrote:
>> Why can we assume setlocale exists?
>> Is it POSIX?
>
> Even more: It's specified by ISO C 99.
Even more than that: it's in C90 also.
--
Ben Pfaff
email: [EMAIL PROTECTED]
web: http://benpfaff.org
Bruno Haible <[EMAIL PROTECTED]> writes:
> Simon Josefsson wrote:
>> Why can we assume setlocale exists?
>
> Because we haven't encountered systems without a setlocale() for 10 years.
> The last such system that I remember was Linux libc5 5.0.xx or 5.2.xx.
>
>
Simon Josefsson wrote:
> Why can we assume setlocale exists?
Because we haven't encountered systems without a setlocale() for 10 years.
The last such system that I remember was Linux libc5 5.0.xx or 5.2.xx.
> Is it POSIX?
Even more: It's specified by ISO C 99.
Bruno
Bruno Haible <[EMAIL PROTECTED]> writes:
> The reason is that HAVE_SETLOCALE is tested, but nowhere defined. Since one
> can assume setlocale() already for ca. 5 years, there is no risk in removing
> the HAVE_SETLOCALE. Here is a proposed patch.
I'm still testing for setlo
53 matches
Mail list logo