Re: Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-12 Thread Paolo Bonzini
Il 12/06/2012 03:22, Isaac Dunham ha scritto: Performance, surely. But if there's consensus that performance does not matter that much with musl, perhaps we should default to the slow version with musl. The test as it stands is error out on unsupported platforms unless user specifies

Re: rationale for closein

2012-06-18 Thread Eric Blake
On 06/18/2012 06:01 PM, Rich Felker wrote: If the closeout approach works best for coreutils, that's the business of the coreutils' maintainers, not my business. However, as I discussed on the musl list, I think it's bad design, and I would highly recommend other projects not follow

Re: rationale for closein

2012-06-18 Thread Rich Felker
On Mon, Jun 18, 2012 at 08:17:25PM -0600, Eric Blake wrote: On 06/18/2012 06:01 PM, Rich Felker wrote: If the closeout approach works best for coreutils, that's the business of the coreutils' maintainers, not my business. However, as I discussed on the musl list, I think it's bad

strtold: work around Cygwin bug

2019-12-12 Thread Bruno Haible
fi +], [dnl The last known bugs in glibc strtold(), as of this writing, dnl were fixed in version 2.8 AC_EGREP_CPP([Lucky user], @@ -101,6 +116,8 @@ numeric_equal (long double x, long double y) [case "$host_os" in # Guess y

Re: [PATCH] tests: skip thread-using tests when threading is disabled

2020-01-05 Thread Bruno Haible
r *argv[]) return 0; } +#else + +/* No multithreading available. */ + +#include + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif + /* Without locking, the results of this test would be: glibcOK mus

tzset: Remove workaround for Solaris 2.6

2020-07-26 Thread Bruno Haible
|| p->tm_sec != s.tm_sec); -} - ]])], - [gl_cv_func_tzset_clobber=no], - [gl_cv_func_tzset_clobber=yes], - [case "$host_os" in - # Guess all is fine on glibc systems. - *-gnu* | gnu*) gl_cv_func_tzset_clobber="guessing no" ;; -

ffsll: Override completely broken implementation on AIX in 32-bit mode

2021-01-04 Thread Bruno Haible
# Guess yes on glibc systems. +*-gnu* | gnu*) gl_cv_func_ffsll_works="guessing yes" ;; + # Guess yes on musl systems. +*-musl*) gl_cv_func_ffsll_works="guessing yes" ;; + #

expm1f-ieee: Work around AIX 7.2 bug

2021-01-05 Thread Bruno Haible
v_func_expm1f_ieee=yes], + [gl_cv_func_expm1f_ieee=no], + [case "$host_os" in +# Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_expm1f_ieee="guessing yes" ;; +# Guess yes on musl systems.

localeconv: Work around a mingw bug

2023-04-27 Thread Bruno Haible
es], + [gl_cv_func_localeconv_works=no], + [case "$host_os" in +# Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_localeconv_works="guessing yes" ;; +# Guess y

Re: Android NDK r26 and utmpx

2024-01-20 Thread Paul Eggert
@@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf, # if READUTMP_USE_SYSTEMD || HAVE_UTMPX_H || HAVE_UTMP_H -# if defined UTMP_NAME_FUNCTION /* glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, IRIX, Solaris, Cygwin, Android */ +# ifdef __ANDROID__

fenv-*: Fix for FreeBSD/powerpc64 and NetBSD/powerpc

2024-01-19 Thread Bruno Haible
c b/tests/test-fenv-except-trapping-2.c index 57b9341f46..257107d2ee 100644 --- a/tests/test-fenv-except-trapping-2.c +++ b/tests/test-fenv-except-trapping-2.c @@ -433,8 +433,8 @@ main (int argc, char *argv[]) GNU/kFreeBSD/i386, GNU/kFreeBSD/x86_64, musl li

Re: gnulib portability issues

2012-06-10 Thread Rich Felker
in practice. No, ungetc normally can only unget one character. musl is fairly unique in allowing you to unget more, and this is not really intentional, just a consequence of the fact that we don't do any buffer switching for unget. Did you miss the end of my last email? I already sent a sketch

Re: gnulib portability issues

2012-06-11 Thread Eric Blake
). As for musl, would adding __freadahead be sufficient to make it use __freadahead, or does gnulib hard-code knowledge about which systems have which stdio extension functions? Depending on the function name you choose, we would have to add an m4 check to see if __freadahead() is defined; but once we know

Re: gnulib portability issues

2012-06-11 Thread Rich Felker
. As for musl, would adding __freadahead be sufficient to make it use __freadahead, or does gnulib hard-code knowledge about which systems have which stdio extension functions? Depending on the function name you choose, we would have to add an m4 check to see if __freadahead() is defined

Re: why is MB_LEN_MAX so large (16) on glibc

2015-05-13 Thread Bruno Haible
to be not worth the effort (as the user experience with filenames and shell in such locales was found to be terrible). BTW I see MB_LEN_MAX is 4 on musl libc. The value of 4 is sufficient to accommodate all stateless encodings in use, including UTF-8 (which was restricted from max. 6 to 4 bytes

Re: what platforms are you testing on?

2016-10-20 Thread Bruno Haible
that are supported are Windows XP and newer. Only the latest version of mingw is tested; older versions are not supported. * GNU Hurd 0.7 is rarely tested. * NetBSD 7.0 or newer is rarely tested. * Native Windows, with MSVC as compiler, is rarely tested and low priority. * musl libc

announcing support for C++

2019-12-11 Thread Bruno Haible
A testdir created with ./gnulib-tool --create-testdir --dir=../testdir1 --single-configure --with-c++-tests `./posix-modules` is now known to build fine on the following platforms: - glibc - musl libc - macOS 10.13 - FreeBSD 12 - NetBSD 7 - OpenBSD 6.5 - Solaris 10, 11.0, 11.4

Re: iconv replacements

2020-07-30 Thread Bruno Haible
given. In this code, it needs to analyze what iconv() actually did and distinguish replacements that are OK (no need to activate the ASCII fallback) and those that are worse than the ASCII fallback. For example: - Replacing 'ç' with '?' (NetBSD, Solaris 11) or '*' (musl) or NUL (IRIX)

Re: ptrdiff_t overflow checks for malloc-posix etc.

2021-04-18 Thread Paul Eggert
esult = !p; free (p); return result;]]) @@ -23,22 +24,17 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], [ac_cv_func_malloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | gnu* | *-musl* | freebsd* | m

Fix cross-compilation test results

2021-07-17 Thread Bruno Haible
Before testing __GNU_LIBRARY__, one has to include either (which only exists on glibc, musl, Android, and Cygwin systems) or some header file such as or . 2021-07-17 Bruno Haible Fix cross-compilation test results. * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross

fenv-exceptions-tracking-c99: Work around a NetBSD/x86_64 bug

2023-11-04 Thread Bruno Haible
gives unlimited permission to copy and/or distribute it, @@ -20,6 +20,8 @@ AC_DEFUN_ONCE([gl_FENV_EXCEPTIONS_TRACKING] dnl On musl libc, on those CPUs where fenv-except-tracking-raise.c dnl uses the "generic" approach, feraiseexcept does not trigger traps dnl because

Re: argp: Correct documentation

2022-12-06 Thread Alfred M. Szmidt
d even if it did the little extra is worth to mention our own operating system in a list of other operating systems. - Is Alpine Linux a GNU system? (It uses musl libc instead of glibc.) [4] No, Alpine is not based on the GNU system, much like Android. See https://www.gnu.org/philosophy/android-an

vasnwprintf-posix: Work around %La bug in glibc 2.15 and Haiku

2023-04-07 Thread Bruno Haible
[ + #include + #ifdef __GNU_LIBRARY__ +#if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + Unlucky +#endif + #endif + ], +

[PATCH] Do not decorate symbols as dllexport on Cygwin

2023-02-05 Thread Corinna Vinschen
char *buf, size_t bufsize) # elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */ extern -# if defined _WIN32 || defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ __declspec(dllimport) # endif pthread_mutex_t *gl_get

Re: bug#64937: "who" reports funny dates

2023-08-08 Thread Thorsten Kukuk
mp. Something emacs needs to get fixed. On musl libc systems like Alpine, you don't have utmp nor wtmp. Beside that the emacs heuristic to find backups of wmtp is very questionable, it wouldn't match on any of my systems. There are better ways to determine the boot time. > I expect that other

localename: Notice setlocale() invocations on more platforms

2024-02-14 Thread Bruno Haible
: musl, FreeBSD, NetBSD, Solaris, Haiku. This patch does it. (This was on my TODO list for GNU gettext for many years.) 2024-02-14 Bruno Haible localename: Notice setlocale() invocations on more platforms. * lib/localename.c (HAVE_LOCALE_NULL): Define also on musl, FreeBSD

new module 'fenv-environment'

2023-11-05 Thread Bruno Haible
. * doc/posix-functions/feholdexcept.texi: Mention the new module and the bugs on glibc, musl libc, FreeBSD, AIX, mingw, MSVC. * doc/posix-functions/fesetenv.texi: Mention the new module and the bugs on musl libc, FreeBSD, NetBSD, AIX, Solaris, Cygwin, mingw, MSVC

Re: parse-datetime test failure

2020-11-11 Thread Paul Eggert
' failed Aborted So, to me it looks like a regression between Alpine Linux 3.9 and 3.10. It's arguably a bug in the test case, since Alpine uses musl libc which does not support time zone abbreviations longer than 6 bytes, whereas the test case uses an time zone abbreviation of 2000 bytes (to te

wcscmp: Work around two ISO C compliance bugs on several platforms

2023-04-18 Thread Bruno Haible
easoning, see <https://www.openwall.com/lists/musl/2023/04/18/5>. In particular, the module 'wcscmp' is no longer obsolete. 2023-04-18 Bruno Haible wcscmp: Add tests. * tests/test-wcscmp.c: New file, based on tests/unistr/test-strcmp.h. * modules/wcscmp-tests: New f

Re: getopt.m4 test

2012-06-23 Thread Bruno Haible
Hi Paul, Eric, I wrote: It seems to me that - musl's getopt is POSIX compliant (at least it passes the 3 parts of the test when run individually). - The getopt.m4 test fails only because musl does not support one of the 3 known ways to reset option processing. Does it support

Re: -Wlto-type-mismatch warning in error()

2022-12-08 Thread Arsen Arsenović via Gnulib discussion list
s a mismatch with the one emitted by install-info.o (the T error symbol) and hence warns. I imagine this would result is some very strange runtime failures if anyone ever observed install-info hit an xalloc_die condition. As a test, building on musl (which lacks the error API, for some reason)

Re: why is MB_LEN_MAX so large (16) on glibc

2015-05-14 Thread Pádraig Brady
encodings such as ISO-2022-JP-2. This later turned out to be not worth the effort (as the user experience with filenames and shell in such locales was found to be terrible). Excellent. Info like that is nigh on impossible to search for. BTW I see MB_LEN_MAX is 4 on musl libc. The value of 4

relocatable-prog: Use $ORIGIN trick on more platforms

2019-02-19 Thread Bruno Haible
# For the platforms that support $ORIGIN, see + # <https://lekensteyn.nl/rpath.html>. + # glibc systems, Linux with musl libc: yes. Android: no. + # Hurd: no <http://lists.gnu.org/archive/html/bug-hurd/2019-02/msg00049.html>. + linux*-android*) ;; + gnu*) ;; linux*

new module 'setlocale-null'

2019-12-15 Thread Bruno Haible
afe on OpenBSD, AIX. * querying the name of the global locale (LC_ALL case) A unit test shows that this is not MT-safe on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. This info, together with a test program that runs setlocale(...,NULL) in different threads at different

[PATCH 1/2] dfa: remove struct lexer_state.cur_mb_len

2019-12-17 Thread Paul Eggert
removed. + 2019-12-16 Bruno Haible setlocale-null: Remove need for -lpthread on musl libc, *BSD, Haiku. diff --git a/lib/dfa.c b/lib/dfa.c index 6b89613a9..fa947463b 100644 --- a/lib/dfa.c +++ b/lib/dfa.c @@ -422,9 +422,6 @@ struct lexer_state MB_CUR_MAX > 1. */ wint_t wc

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-24 Thread Bruno Haible
t;); + fclose (fp); + fp = fopen ("conftest.x", "wx"); + if (fp != NULL) +/* 'x' ignored */ +return 1; + else if (errno == EEXIST) +return 0; + else +/* 'x' rejected */ +return 2; +}]])], + [gl_cv_func_fopen_mode_x=yes], + [gl_cv_func_fopen_mod

fenv-exceptions-tracking-c99 tests: Enhance tests

2023-11-05 Thread Bruno Haible
@@ #include #include +#include +#include -#include "fpe-trapping.h" #include "macros.h" /* musl libc does not support floating-point exception trapping, even where the hardware supports it. See <https://wiki.musl-libc.org/functional-diff

simplify fpe-tracking and fpe-trapping modules

2023-11-05 Thread Bruno Haible
w %0" : : "m" (*)); -__asm__ __volatile__ ("ldmxcsr %0" : : "m" (*)); - } - } - - return 0; -} - -#elif defined _WIN32 && !defined __CYGWIN__ -/* native Windows */ - -# include - -static int -sigfpe_on_invalid () -{ - /* Documentation: -

Re: argp: Correct documentation

2022-12-07 Thread Alfred M. Szmidt
e useful to put it up on gnu.org. I do not recall any such thing from RMS having been announced around that time, or at all. > - Is Alpine Linux a GNU system? (It uses musl libc instead of glibc.) [4] > > No, Alpine is not based on the GNU system ... > > -

Android and the C locale

2023-01-16 Thread Bruno Haible
cter. */ buf[0] = c; + wc = (char32_t) 0xBADFACE; ret = mbrtoc32 (, buf, 1, ); ASSERT (ret == 1); - if (c < 0x80) -/* c is an ASCII character. */ -ASSERT (wc == c); - else -/* argv

Re: backupfile and backup-rename are introducing the same object to make

2023-01-25 Thread (GalaxyMaster)
ch compiler: $CC = ? $CFLAGS = ? $CPPFLAGS = ? $LDFLAGS = ? > - which linker is being used by the compiler?, I am not sure this would be helpful, since as I described my use case is definitely not something GNU Lib supports, but for the context purposes: the system is musl based wi

wmemcmp: Work around ISO C compliance bug on several platforms

2023-04-18 Thread Bruno Haible
These two patches work around an ISO C compliance bug of wmemcmp() on several platforms. The point is that in ISO C, a "wide character" is any wchar_t value. A "wide character" is not constrained to the range 0..INT_MAX. For the precise reasoning, see <https://www.openwall

Re: doc: Clarify list of platforms for year2038 support

2023-04-11 Thread Paul Eggert
y, microblaze, nios2, +x86, arm, mips (32-bit or n32 ABI), powerpc32, sparc32, s390, hppa, m68k, sh, csky, microblaze, nios2, @item Linux kernel 5.1 (2019) and later with musl libc 1.2 (2020) and later on x86, @item -Linux on arc, loong32, riscv32 and x86_64-x32, +Linux on arc, loong32, ork1, ris

Re: today's Gnulib autoupdate changed quoting style in INSTALL?

2024-01-07 Thread Paul Eggert
e makeinfo + by default outputs ASCII approximations to characters. + 2024-01-02 Bruno Haible strverscmp: Work around bug in musl libc 1.2.3 and in Cygwin. diff --git a/doc/Makefile b/doc/Makefile index 19e3c34dde..2cb1dc2e77 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,9 +9,11 @@ do

Re: bug#70070: FAIL: test-localtime_r

2024-03-30 Thread Paul Eggert
0 - 1900 + && result->tm_wday == 4 + && result->tm_yday == 0 + && result->tm_isdst == 0)) + { +fputs ("Skipping test: TZ='Europe/Paris' is not Paris time\n", + stderr); +return 77; + } + } + /* Note: The result->tm_gmtoff values and the result->tm_zone values are the same (3600, "CET" or 7200, "CEST") across all tested platforms: glibc, musl, macOS, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin, Android. */ -- 2.44.0

Re: quotearg: shell escape issue with single quote

2024-03-31 Thread Bruno Haible
/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-03-31 Bruno Haible + + quotearg: Improve documentation. + * lib/quotearg.h: Refer to specification of $'...' syntax. Document a + limitation of QA_ELIDE_OUTER_QUOTES. + 2024-03-31 Bruno Haible canonicalize[-lgpl] tests: Fix test failure

Update HACKING

2024-04-23 Thread Bruno Haible
directory on various plaforms: + - Linux/glibc systems, + - Linux/musl systems, + - macOS, + - FreeBSD, + - NetBSD, + - OpenBSD, + - AIX, + - Solaris 10 and 11, + - Cygwin, + - Haiku, + - Android, + - and other platforms of your choice. + +There is a continuous integration that regularly p

*printf-posix: ISO C 23: Add %b directive for binary output of integers

2023-03-17 Thread Bruno Haible
he @samp{b} directive, required by ISO C23, +on some platforms: +glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, +AIX 7.2, Solaris 11.4, Cygwin 2.9.0. +@item This function does not support the @samp{F} directive on some platforms: NetBSD 3.0, Cygwin 1.5.x. @item d

Re: gl_{,SN}PRINTF_DIRECTIVE_N wrongly fail on Ubuntu 18.04

2020-03-08 Thread Bruno Haible
]])], + [gl_cv_func_snprintf_directive_n="guessing yes"], + [gl_cv_func_snprintf_directive_n="guessing no"]) + ;; # Guess yes on musl systems. *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on FreeBSD >= 5.

gettimeofday: Remove workaround for Mac OS X 10.0

2020-07-26 Thread Bruno Haible
, _lt, sizeof (struct tm)) != 0; -]])], - [gl_cv_func_gettimeofday_clobber=no], - [gl_cv_func_gettimeofday_clobber=yes], - [# When cross-compiling: - case "$host_os" in - # Guess all is fine on glibc systems. -*-gnu* | gnu*) gl_cv_func_gettimeofday_clobb

fenv-*: Port to Haiku

2023-11-05 Thread Bruno Haible
5be675..3523dbb8f8 100644 --- a/doc/posix-functions/fesetexceptflag.texi +++ b/doc/posix-functions/fesetexceptflag.texi @@ -17,7 +17,7 @@ glibc 2.37/i386, glibc 2.37/x86_64, @c https://sourceware.org/bugzilla/show_bug.cgi?id=30988 glibc 2.37/powerpc, -musl libc, Mac OS X 10.5, mingw. +musl libc, Ma

readutmp: On Cygwin and Windows, return the boot time

2023-08-11 Thread Bruno Haible
amp;& errno == ESRCH)) return false; +# endif return true; } @@ -359,7 +361,9 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf, struct utmp_alloc a = {0}; -# if defined UTMP_NAME_FUNCTION /* glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, IRIX,

new module 'fenv-exceptions-state-c99'

2023-10-30 Thread Bruno Haible
This new module implements the ISO C 99 functions for saving and restoring the floating-point exception flags. The unit tests uncovered bugs in glibc, musl libc (*), macOS, AIX, mingw. (*) The one on musl libc is a documented limitation. 2023-10-30 Bruno Haible fenv-exceptions

Re: free-posix: New module, renamed from 'free'

2020-12-19 Thread Bruno Haible
nux (!). Thanks; I intended to propose this change and ask you whether it's OK with you. I noted the test failure on: Linux 2.4.22 / glibc 2.3.2 (Fedora 1) Linux 4.4 / glibc 2.23 (Ubuntu 16.04) Linux 4.18 / glibc 2.28 (CentOS 8) Linux 5.8 / glibc 2.32 (Ubuntu 20.10) as well as Linux 5.4.4

Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-11 Thread Sam James
d list for certain CHOSTs as Rich suggests to reduce noise, but I don't think we can do this accurately very quickly. I think for Gentoo's efforts, I might just build up a set of cache variables for glibc/musl on each arch to reduce the noise in logs. But that's time consuming and brittle stil

stdio: ISO C 23: Define _PRINTF_NAN_LEN_MAX

2023-03-25 Thread Bruno Haible
gn. */ +# define _PRINTF_NAN_LEN_MAX 3 +# elif (__GLIBC__ >= 2) || MUSL_LIBC || defined __sun || defined __CYGWIN__ +/* glibc, musl libc, Solaris libc, and Cygwin produce "[-]nan". */ +# define _PRINTF_NAN_LEN_MAX 4 +# elif defined _AIX +/* AIX produces "[-]NaNQ". */ +# def

Re: vasnwprintf: Fix module dependencies

2023-03-20 Thread Bruno Haible
23-03-19 Bruno Haible vasnwprintf: Fix test failures on musl libc. diff --git a/lib/wmemcpy-impl.h b/lib/wmemcpy-impl.h index f0a7007506..c243acfa15 100644 --- a/lib/wmemcpy-impl.h +++ b/lib/wmemcpy-impl.h @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modi

wcsncmp: Work around two ISO C compliance bugs on several platforms

2023-04-19 Thread Bruno Haible
six-functions/wcsncmp.texi +++ b/doc/posix-functions/wcsncmp.texi @@ -8,6 +8,14 @@ Portability problems fixed by Gnulib: @itemize +@item +This function compares the wide characters as if they were unsigned, although +@code{wchar_t} is signed, on some platforms: +glibc 2.14.1 on x86 or x86_64, m

*c32*: Inline most functions on glibc and musl libc

2023-04-04 Thread Bruno Haible
The type 'char32_t' is a more modern alternative to 'wchar_t', because it solves the problems mentioned in <https://www.gnu.org/software/libunistring/manual/html_node/The-wchar_005ft-mess.html>. To make a migration from 'wchar_t' to 'char32_t' attractive, it is important that on glibc an

unistr/u*strstr tests: Add more tests

2023-04-02 Thread Bruno Haible
d) free (needle); free (haystack); } + + /* Test case from Yves Bastide. + <https://www.openwall.com/lists/musl/2014/04/18/2> */ + { +const UNIT input[] = + { 'p', 'l', 'a', 'y', 'i', 'n', 'g', ' ', 'p', 'l', 'a', 'y', ' ', 'p', +'l', 'a', 'y', ' ',

Re: MT-unsafe time modules

2024-02-11 Thread Bruno Haible
min == 40); +ASSERT (result->tm_hour == 6); +ASSERT (result->tm_mday == 26); +ASSERT (result->tm_mon == 10 - 1); +ASSERT (result->tm_year == 2017 - 1900); +ASSERT (result->tm_wday == 4); +ASSERT (result->tm_yday == 298); +ASSERT (result->tm_isdst == 0); +#if HAVE_STRUCT_

Re: autoreconf --force seemingly does not forcibly update everything

2024-04-09 Thread Bruno Haible
native-ld/with-mold that contains a symlink ld -> /.../bin/mold and use CC="gcc -B/alternative-ld/with-mold". On exotic systems with non-ELF binary format, modifying libtool.m4 is needed. But most distros are not in this situation; they use the glibc or musl dynamic loader

new module 'fenv-exceptions-trapping'

2023-10-31 Thread Bruno Haible
is missing on some platforms: +macOS 11.1, musl libc, FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 1.7.7, mingw, MSVC 14, Android 4.4. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing

getpass: move declaration to

2018-08-19 Thread Bruno Haible
/test-unistd-c++.cc: Test also the declaration of 'getpass'. * doc/glibc-functions/getpass.texi: A length limit exists also on uClibc and musl. * NEWS: Mention the change. diff --git a/NEWS b/NEWS index 1328e73..e763c91 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,9 @@ User visibl

Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems

2020-02-16 Thread Bruno Haible
1 0 rpl_lstat,chmod save_cwd,chmod,lchmod,... HP-UX 1 0 rpl_lstat,chmod save_cwd,chmod,lchmod,... musl/Linux 1 0 fchmodat -- glibc/Hurd 1 0 fchmodat

Re: gnulib / autoconf sync

2020-12-23 Thread Bruno Haible
, + [ac_cv_func_getgroups_works=no], + [case "$host_os" in # (( + # Guess yes on glibc systems. +*-gnu* | gnu*) ac_cv_func_getgroups_works="guessing yes" ;; + # Guess yes on musl systems. +*-musl*) ac_

*printf-posix: Work around bug with %#.0x on Mac OS X 10.6

2023-10-03 Thread Bruno Haible
than 512 or 1024 in integer, floating-point and pointer output on some platforms: AIX 7.1, Solaris 10/x86, mingw, MSVC/clang. diff --git a/doc/posix-functions/fwprintf.texi b/doc/posix-functions/fwprintf.texi index db42363cfa..fed553f2b5 100644 --- a/doc/posix-functions/fwprintf.texi +++ b/doc/posi

Re: recommending AC_SYS_YEAR2038_REQUIRED ?

2023-04-10 Thread Paul Eggert
ABI), powerpc, sparc, s390, hppa, m68k, sh, csky, microblaze, nios2, @item -Linux with musl libc on x86, -@item -Linux/riscv32, -@item -Mac OS X on x86 and powerpc, -@item -GNU/Hurd/x86, -@item -GNU/kFreeBSD/x86, -@item -FreeBSD/x86, +Linux kernel 5.1 (2019) and later with musl libc 1.2 (2020) and

tests for quiet NaNs and signalling NaNs

2023-10-12 Thread Bruno Haible
} + } + + return 0; +} + +#elif defined _WIN32 && !defined __CYGWIN__ +/* native Windows */ + +# include + +static int +sigfpe_on_invalid () +{ + /* Documentation: + <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/controlfp-s> */ + unsigned int co

more tests against glibc C locale bug

2023-04-03 Thread Bruno Haible
else /* On most platforms, the bytes 0x80..0xFF map to U+0080..U+00FF. But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF. */ - ASSERT (wc == (btowc (c) == 0xDF00 + c ? btowc (c) : c)); + ASSER

improve clang support (9)

2020-08-09 Thread Bruno Haible
gl_cv_func_signbit_gcc="guessing yes" ;; + *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on musl systems. - *-musl*) gl_cv_func_signbit_gcc="guessing yes" ;; + *-musl*) gl_cv_func_signbit

fenv-* tests: Add tests of the link dependencies

2023-11-07 Thread Bruno Haible
100644 --- a/tests/test-fenv-except-state-2.c +++ b/tests/test-fenv-except-state-2.c @@ -21,25 +21,13 @@ /* Specification. */ #include -#include - -#include "fpe-trapping.h" #include "macros.h" -/* musl libc does not support floating-point exception trapping, ev

Re: From wchar_t to char32_t, new module mbszero

2023-07-16 Thread Paul Eggert
L_LIBC /* musl libc */ /* mbstate_t is defined in . It is an opaque aligned 8-byte struct, of which at most the first 4 bytes are used. For more details, see src/multibyte/mbrtowc.c. */ # define _GL_MBSTATE_INIT_SIZE 4 # define _GL_MBSTATE_ZERO_SIZE 4

fnmatch, fnmatch-gnu: Document known bugs

2023-07-23 Thread Bruno Haible
} is not defined on all non-glibc platforms: +musl libc, macOS 12.5, FreeBSD 13.2, NetBSD 9.3, OpenBSD 7.2, Minix 3.3, AIX 7.2, HP-UX 11.31, IRIX 6.5, Solaris 11.4, Cygwin 3.4.6, Android 13. +@item +The macro @code{FNM_FILE_NAME} is not defined on some platforms: +NetBSD 9.3, AIX 7.2, HP-UX 11.31

nstrftime: Add tests of all directives, also in non-trivial locales

2024-02-07 Thread Bruno Haible
int fail = 0; fail |= posixtm_test (); fail |= tzalloc_test (); fail |= quarter_test (); fail |= errno_test (); + if (is_C_locale) +fail |= locales_test (english); + else +{ +#if MUSL_LIBC + if (fail == 0) +{ + fputs ("Skipping test: musl libc do

critique of gnulib

2019-08-31 Thread Bruno Haible
it assumes the > very worst about the operating system when it can't perform runtime > tests, which leads to the maximum amount of gnulib being enabled. > Depending on how much of gnulib is included, in the worst case, gnulib > might attempt to replace large parts of the standard librar

Re: bug#39236: [musl] coreutils cp mishandles error return from lchmod

2020-02-08 Thread Bruno Haible
Hi Paul, > similarly for lchmod on non-symlinks. When I see a new autoconf test that activates an override, in order to guarantee a certain documented behaviour, I like to add a unit test - because in the past we several times had an override that would not have passed the autoconf test either.

Re: configure messages: check for features, not for bugs

2020-08-26 Thread Bruno Haible
k], +[gl_cv_func_getcwd_succeeds_beyond_4k], [# Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. @@ -126,7 +126,7 @@ main () return fail; } ]])], - [gl_cv_func_getcwd_abort_bug=no], + [gl_cv_func

configure messages: check for features, not for bugs

2020-07-26 Thread Bruno Haible
nts of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. @@ -128,7 +128,7 @@ main () return fail; } ]])], - [gl_cv_func_getcwd_abort_bug=no], + [gl_cv_func_getcwd_succeeds_beyond_4k=yes], [dnl An abort will pro

[PATCH] Further improve cross-compilation guesses for midipix

2024-02-02 Thread Ørjan Malde
+ b/ChangeLog @@ -1,3 +1,14 @@ +2024-02-02 Ørjan Malde + + Further improve cross-compilation for midipix. +* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Guess yes for midipix. +* m4/rename.m4 (gl_FUNC_RENAME): Treat midipix like Linux with glibc or + musl libc. +*

physmem: Port better to Linux

2024-04-24 Thread Bruno Haible
ux, AIX, HP-UX, IRIX, OSF/1, Solaris, Cygwin, Android */ # include #endif -#if HAVE_MACHINE_HAL_SYSINFO_H +#if HAVE_MACHINE_HAL_SYSINFO_H /* OSF/1 */ # include #endif -#if HAVE_SYS_TABLE_H +#if HAVE_SYS_TABLE_H /* OSF/1 */ # include #endif @@ -51,13 +54,16 @@ #endif #if HAVE_SYS_SYSCTL_H &a

*printf-posix: Work around bug with %lc of 0 on many platforms

2023-03-21 Thread Bruno Haible
After adding a few more tests for *printf %c and %lc, I noticed yet another *printf bug. This time not in musl libc, but in _all_ platforms other than musl libc. For glibc, I registered it as https://sourceware.org/bugzilla/show_bug.cgi?id=30257 . This patch adds a workaround to the (narrow

striconveha, uniconv/*: avoid test failures on musl libc

2018-02-24 Thread Bruno Haible
On Alpine Linux 3.7.0, which uses musl libc, I see these test failures in libunistring: FAIL: test-striconveha == ../../tests/test-striconveha.c:327: assertion 'retval == 0' failed FAIL test-striconveha (exit status: 134) FAIL: test-u16-conv-from-enc

nl_langinfo: fix multithread-safety bugs

2019-12-17 Thread Bruno Haible
@@ OpenBSD 3.8. @item The constants @code{ALTMON_1} to @code{ALTMON_12} are not defined on some platforms: -glibc 2.26 and many others. +glibc 2.26, musl libc, Mac OS X 10.13, NetBSD 8.0, OpenBSD 6.5, AIX 7.2, HP-UX 11.31, IRIX 6.5, Solaris 11.4, Haiku, Cygwin 2.9. @item The constants @code{ERA}, @code

improve clang support (29)

2020-08-15 Thread Bruno Haible
clang on Windows, by default, does not link with '-loldnames' (like mingw and MSVC 14 do). This means that programs that use open(), close(), etc. will get link errors by default. For more than 10 years, Microsoft has been deprecating these function names: access chdir chmod close creat dup dup2

Re: fchmodat.c & lchmod.c - O_PATH & AT_EMPTY_PATH on older kernels

2022-06-21 Thread Bruno Haible
quot;/", desired) == 0) + result |= 2; +else if (errno != ENOTDIR) + result |= 4; +return result; + ]])], + [gl_cv_func_chmod_works=yes], + [gl_cv_func_chmod_works=no], + [case "$host_os" in + # Guess no on AIX, IRIX,

new module 'setlocale_null-unlocked'

2024-02-15 Thread Bruno Haible
{ @@ -181,7 +181,7 @@ setlocale_null_unlocked (int category, char *buf, size_t bufsize) #if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin < 3.4.6 */ -/* Use a lock, so that no two threads can invoke setlocale_nu

Resolve conflicts for functions introduced in Android API level 34

2024-01-25 Thread Bruno Haible
Doc regarding functions introduced in Android API level 33. diff --git a/lib/freadahead.h b/lib/freadahead.h index 35052c1c19..f4fc26cbd7 100644 --- a/lib/freadahead.h +++ b/lib/freadahead.h @@ -32,7 +32,7 @@ STREAM must not be wide-character oriented. */ -#if HAVE___FREADAHEAD /* musl libc

[PATCH] fflush: be more paranoid about libio.h change

2018-03-08 Thread Paul Eggert
nd - fp->_IO_read_ptr; diff --git a/lib/freadseek.c b/lib/freadseek.c index 5fd2dd7ca..b11845cd5 100644 --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -36,7 +36,8 @@ freadptrinc (FILE *fp, size_t increment) /* Keep this code in sync with freadptr! */ #if HAVE___FREADPTRINC /*

random: Fix multithread-safety bug in general

2023-11-10 Thread Bruno Haible
Since CheriBSD is derived from FreeBSD, it sounds likely that FreeBSD's random() function is equally not multithread-safe. To verify this hypothesis, I wrote a MT-safety test for random(). The result (with a REPEAT_COUNT of 100): glibc OK musl libc OK FreeBSD 11.0 Expected value

Re: bug#64937: "who" reports funny dates

2023-08-08 Thread Bruno Haible
CT_UTMP **utmp_buf, free (sessions); } - /* Relocate the string pointers back to their natural position. */ - { -char *stringlim = (char *) a.utmp + a.alloc_bytes; - -for (idx_t i = 0; i < a.filled; i++) - { -a.utmp[i].ut_user = (intptr_t) a.utmp[i].ut_user + strin

asyncsafe-spin: Fix link error on various platforms

2024-01-21 Thread Bruno Haible
- m68k, for gcc versions >= 4.7, but only for Linux # - mips, never at all # * The NetBSD C library provides this function on # - arm, arm64, # - i386, # - sparc, # - m68k, # - riscv64. # Other C libraries (e.g. glibc, musl libc) do not pr

[PATCH] configmake: Avoid namespace pollution issue on mingw.

2019-08-08 Thread Eric Blake
ate a18f7ce3c term-style-control tests: Fix link error. 4a468b774 term-style-control: Fix typo in comment. 7c4dbc521 term-style-control: Add tests. 993d0646c term-style-control: New module. 092288d12 autoupdate 0d8714b7c _Noreturn: beware of C's _Noreturn in C++ pre C++11 453ff9404 Support cro

new module 'fenv-exceptions-tracking-c99'

2023-10-28 Thread Bruno Haible
+} + +# elif defined __s390__ || defined __s390x__ + +int +feclearexcept (int exceptions) +{ + exceptions &= FE_ALL_EXCEPT; + + unsigned int fpc, orig_fpc; + _FPU_GETCW (orig_fpc); +# if FE_INEXACT == 8 /* glibc compatible FE_* values */ + fpc = orig_fpc & ~(exceptions << 16); + if ((fpc &a

Re: fseeko broken by Fedora rawhide glibc / git master (ie future 2.28)

2018-03-05 Thread Daniel P . Berrangé
return ((fp->_flags & _IO_NO_WRITES) != 0 >|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 >&& fp->_IO_read_base != NULL)); > diff --git a/lib/freadptr.c b/lib/freadptr.c > index 5aeadf3da..ffb801039 100644 > --- a/lib/freadp

Re: fseeko broken by Fedora rawhide glibc / git master (ie future 2.28)

2018-03-05 Thread Paul Eggert
LL; size = fp->_IO_read_end - fp->_IO_read_ptr; diff --git a/lib/freadseek.c b/lib/freadseek.c index e7b0c7bdb..5fd2dd7ca 100644 --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -36,7 +36,7 @@ freadptrinc (FILE *fp, size_t increment) /* Keep this code in sync with freadptr! */ #if HAVE

Re: [PATCH] ISO C 11 threads implementation

2019-06-21 Thread Bruno Haible
4, powerpc/powerpc64, ia64, s390/s390x, riscv64, m68k, hppa * Linux with musl libc on i386/x86_64 * GNU/kFreeBSD on i386/x86_64 * Hurd on i386 * Mac OS X 10.13 on x86_64 * FreeBSD 11 and MidnightBSD 0.8 on i386/x86_64, arm64 * NetBSD 7 on i386/x86_64

Re: critique of gnulib

2019-09-01 Thread Jonas 'Sortie' Termansen
new systems). Making cross-compilation nice helps the development of new operating systems, and not just for established things like glibc/musl. As you saw in my gnulib wiki page, I literally inject 120 environment variables to make gnulib assume the very best about my operating system. I'd rather be c

Re: setlocale: make calls with NULL argument multithread-safe

2019-12-18 Thread Bruno Haible
82b6..11364d3 100644 --- a/doc/posix-functions/setlocale.texi +++ b/doc/posix-functions/setlocale.texi @@ -34,7 +34,7 @@ platforms: musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. To make these invocations multithread-safe, you need the Gnulib module @code{setlocale}, or yo

Re: nl_langinfo-mt failure on Solaris 10 x86

2020-09-19 Thread Bruno Haible
CriticalSection (lock); + ret = nl_langinfo_unlocked (item); + LeaveCriticalSection (lock); + + return ret; +} + +# elif HAVE_PTHREAD_API + +extern +# if defined _WIN32 || defined __CYGWIN__ + __declspec(dllimport) +# endif + pthread_mutex_t *gl_get_nl_langinfo_lock (void); + +#

<    1   2   3   4   5   >