]> Savannah Git Hosting - gnulib.git/log
gnulib.git
5 years agodfa: fast->small for array elements
Paul Eggert [Thu, 19 Dec 2019 21:37:45 +0000 (13:37 -0800)]
dfa: fast->small for array elements

* lib/dfa.c (charclass_word): Use uint_least64_t not uint_fast64_t,
since this type is used in arrays.  This change is more for
documentation than for any practical effect, since the two types
are the same on all known platforms.

5 years agoiconv tests: Test canonicalized, not system-dependent, encoding names.
Bruno Haible [Thu, 19 Dec 2019 05:20:30 +0000 (06:20 +0100)]
iconv tests: Test canonicalized, not system-dependent, encoding names.

* modules/iconv-tests (Depends-on): Add iconv_open.

5 years agoiconv tests: Test canonicalized, not system-dependent, encoding names.
Bruno Haible [Thu, 19 Dec 2019 05:15:56 +0000 (06:15 +0100)]
iconv tests: Test canonicalized, not system-dependent, encoding names.

* tests/test-iconv.c (main): Revert part of the 2016-08-17 patch.

5 years agolocalename: Fix test failure on AIX 7.2.
Bruno Haible [Thu, 19 Dec 2019 01:06:00 +0000 (02:06 +0100)]
localename: Fix test failure on AIX 7.2.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Enable nameless
locales on AIX.
* lib/localename.c (gl_locale_name_thread_unsafe): Handle nameless
locales on AIX.

5 years agoImprove port of AC_C_RESTRICT to Oracle C++
Paul Eggert [Thu, 19 Dec 2019 01:05:02 +0000 (17:05 -0800)]
Improve port of AC_C_RESTRICT to Oracle C++

Problem reported by Christian Biesinger in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00159.html
* m4/gnulib-common.m4 (AC_C_RESTRICT): Port better to
Oracle Developer Studio C++ 12.5 or later.

5 years agowchar: Fix test failures on AIX and MSVC (regression from 2019-12-07).
Bruno Haible [Wed, 18 Dec 2019 18:33:27 +0000 (19:33 +0100)]
wchar: Fix test failures on AIX and MSVC (regression from 2019-12-07).

* lib/wchar.in.h (GNULIB_defined_mbstate_t): Do define on AIX and MSVC.

5 years agolocalename: Ensure multithread-safety in future changes.
Bruno Haible [Wed, 18 Dec 2019 16:03:42 +0000 (17:03 +0100)]
localename: Ensure multithread-safety in future changes.

* lib/localename.c (setlocale): Reference the system's setlocale().
(get_locale_t_name): Invoke setlocale_null instead of setlocale.
(gl_locale_name_posix): Likewise.
* modules/localename (Depends-on): Add setlocale-null.

5 years agosetlocale-null: Make API more useful.
Bruno Haible [Wed, 18 Dec 2019 15:30:09 +0000 (16:30 +0100)]
setlocale-null: Make API more useful.

* lib/locale.in.h (setlocale_null_r): Renamed from setlocale_null. All
callers changed.
(setlocale_null): New declaration.
* lib/setlocale_null.c (setlocale_null_androidfix): New function,
extracted from setlocale_null_unlocked.
(setlocale_null_unlocked): Invoke it.
(setlocale_null_r): Renamed from setlocale_null.
(setlocale_null): New function, extracted from setlocale_mtsafe in
setlocale.c.
* lib/setlocale.c: Don't include <errno.h>.
(setlocale_mtsafe): Invoke setlocale_null.
* lib/setlocale-lock.c: Update comments.
* doc/posix-functions/setlocale.texi: Mention both functions.

5 years agolocalename: Optimize code for native Windows.
Bruno Haible [Wed, 18 Dec 2019 14:07:05 +0000 (15:07 +0100)]
localename: Optimize code for native Windows.

* lib/localename.c (gl_locale_name_posix): Remove handling of LC_ALL
category (not allowed here).

5 years agosetlocale: Make calls with NULL argument multithread-safe.
Bruno Haible [Wed, 18 Dec 2019 13:35:27 +0000 (14:35 +0100)]
setlocale: Make calls with NULL argument multithread-safe.

* lib/setlocale.c: Include <errno.h>.
(setlocale_mtsafe): New function.
(setlocale_unixlike): Invoke setlocale_mtsafe instead of setlocale.
(setlocale_improved): Renamed from rpl_setlocale.
* m4/setlocale.m4 (gl_FUNC_SETLOCALE): Require gl_FUNC_SETLOCALE_NULL.
Set and define NEED_SETLOCALE_IMPROVED and NEED_SETLOCALE_MTSAFE. Set
LIB_SETLOCALE.
* modules/setlocale (Depends-on): Add setlocale-null. Update conditions.
(Link): New section.
* tests/locale.c: Undefine setlocale.
* tests/test-setlocale_null-one.c: Likewise.
* tests/test-setlocale_null-all.c: Likewise.
* modules/setlocale-tests (Makefile.am): Link the test programs with
$(LIB_SETLOCALE).
* modules/astrxfrm-tests (Makefile.am): Likewise.
* modules/btowc-tests (Makefile.am): Likewise.
* modules/c-ctype-tests (Makefile.am): Likewise.
* modules/c-snprintf-tests (Makefile.am): Likewise.
* modules/c-strcase-tests (Makefile.am): Likewise.
* modules/c-vasprintf-tests (Makefile.am): Likewise.
* modules/c-vsnprintf-tests (Makefile.am): Likewise.
* modules/c-xvasprintf-tests (Makefile.am): Likewise.
* modules/dfa-tests (Makefile.am): Likewise.
* modules/duplocale-tests (Makefile.am): Likewise.
* modules/hard-locale-tests (Makefile.am): Likewise.
* modules/localcharset-tests (Makefile.am): Likewise.
* modules/localename-tests (Makefile.am): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Likewise.
* modules/mbmemcasecoll-tests (Makefile.am): Likewise.
* modules/mbrtowc-tests (Makefile.am): Likewise.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsinit-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbsnrtowcs-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsrtowcs-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/nl_langinfo-tests (Makefile.am): Likewise.
* modules/quotearg-tests (Makefile.am): Likewise.
* modules/regex-tests (Makefile.am): Likewise.
* modules/strfmon_l-tests (Makefile.am): Likewise.
* modules/strtod-tests (Makefile.am): Likewise.
* modules/strtold-tests (Makefile.am): Likewise.
* modules/unicase/locale-language-tests (Makefile.am): Likewise.
* modules/unicase/ulc-casecmp-tests (Makefile.am): Likewise.
* modules/unicase/ulc-casecoll-tests (Makefile.am): Likewise.
* modules/unigbrk/ulc-grapheme-breaks-tests (Makefile.am): Likewise.
* modules/unistdio/u8-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/u16-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/u32-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
* modules/uniwbrk/ulc-wordbreaks-tests (Makefile.am): Likewise.
* modules/vasnprintf-posix-tests (Makefile.am): Likewise.
* modules/wcrtomb-tests (Makefile.am): Likewise.
* modules/wcsnrtombs-tests (Makefile.am): Likewise.
* modules/wcsrtombs-tests (Makefile.am): Likewise.
* modules/wcwidth-tests (Makefile.am): Likewise.
* doc/posix-functions/setlocale.texi: Mention that the multithread-
safety fix is also available in module 'setlocale'.

5 years agohard-locale: Make multithread-safe.
Bruno Haible [Wed, 18 Dec 2019 10:42:21 +0000 (11:42 +0100)]
hard-locale: Make multithread-safe.

* lib/hard-locale.h (hard_locale): Move documentation to here.
* lib/hard-locale.c: Don't include <stdlib.h>.
(GLIBC_VERSION): Remove macro.
(hard_locale): Assume that all systems name the "C" and "POSIX" locales
"C" or "POSIX". Invoke setlocale_null instead of setlocale.
* modules/hard-locale (Depends-on): Remove strdup. Add setlocale-null.
(configure.ac): Require gl_FUNC_SETLOCALE_NULL. Set LIB_HARD_LOCALE.
(Link): New section.
* modules/hard-locale-tests (Makefile.am): Link test-hard-locale against
$(LIB_HARD_LOCALE).

5 years agohard-locale: Avoid test failure on Haiku.
Bruno Haible [Wed, 18 Dec 2019 10:10:20 +0000 (11:10 +0100)]
hard-locale: Avoid test failure on Haiku.

* tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.

5 years agosetlocale-null: Handle NULL result from setlocale.
Bruno Haible [Wed, 18 Dec 2019 09:49:44 +0000 (10:49 +0100)]
setlocale-null: Handle NULL result from setlocale.

* lib/locale.in.h (setlocale_null): Document EINVAL return value.
* lib/setlocale_null.c (setlocale_null_unlocked): Handle NULL result
from setlocale or _wsetlocale.

5 years agohard-locale: Add test.
Bruno Haible [Wed, 18 Dec 2019 08:41:31 +0000 (09:41 +0100)]
hard-locale: Add test.

* tests/test-hard-locale.c: New file.
* tests/locale.c: New file.
* modules/hard-locale-tests: New file.

5 years agodfa: do not match invalid UTF-8
Paul Eggert [Wed, 18 Dec 2019 05:41:27 +0000 (21:41 -0800)]
dfa: do not match invalid UTF-8

* lib/dfa.c (struct dfa): Grow utf8_anychar_classes member array
from 5 to 9 tokens; this is needed due to the changes to
add_utf8_anychar.
(charclass_index): 2nd arg is now pointer-to-const.
(add_utf8_anychar): Match only valid UTF-8 byte sequences
instead of allowing overlong encodings or surrogate halves.

5 years agodfa: simplify charclass by assuming C99
Paul Eggert [Tue, 17 Dec 2019 22:08:33 +0000 (14:08 -0800)]
dfa: simplify charclass by assuming C99

* lib/dfa.c (CHARCLASS_WORD_BITS): Now always 64.
(charclass_word): Now always uint_fast64_t.
(CHARCLASS_PAIR): Remove.
(CHARCLASS_INIT): Take 4 arguments instead of 8.  All uses changed.

5 years agofts: tune via calloc
Paul Eggert [Tue, 17 Dec 2019 21:09:30 +0000 (13:09 -0800)]
fts: tune via calloc

* lib/fts.c (fts_open): Prefer calloc to malloc + memset.

5 years agodfa: tune via xzalloc
Paul Eggert [Tue, 17 Dec 2019 21:07:15 +0000 (13:07 -0800)]
dfa: tune via xzalloc

* lib/dfa.c (dfaoptimize): Prefer xzalloc to xmalloc + memset.

5 years agolocalcharset: Fix multithread-safety bug on Windows and OS/2.
Bruno Haible [Tue, 17 Dec 2019 14:29:15 +0000 (15:29 +0100)]
localcharset: Fix multithread-safety bug on Windows and OS/2.

* lib/localcharset.h (locale_charset): Clarify when the result becomes
invalid.
* lib/localcharset.c (locale_charset): Use a stack-allocated buffer to
assemble the result.

5 years agolocalcharset: Optimize code for native Windows.
Bruno Haible [Tue, 17 Dec 2019 14:02:12 +0000 (15:02 +0100)]
localcharset: Optimize code for native Windows.

* lib/localcharset.c (locale_charset): Don't both calling
setlocale (LC_ALL, NULL) since we're not interested in its result.

5 years agonl_langinfo: Fix multithread-safety bug on OpenBSD 3.8.
Bruno Haible [Tue, 17 Dec 2019 13:10:45 +0000 (14:10 +0100)]
nl_langinfo: Fix multithread-safety bug on OpenBSD 3.8.

* lib/nl_langinfo.c (ctype_codeset): Invoke setlocale_null instead of
setlocale.
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Require
gl_FUNC_SETLOCALE_NULL. Set LIB_NL_LANGINFO.
* modules/nl_langinfo (Depends-on): Add setlocale-null.

5 years agonl_langinfo: Fix multithread-safety bug on mingw and MSVC.
Bruno Haible [Tue, 17 Dec 2019 13:00:59 +0000 (14:00 +0100)]
nl_langinfo: Fix multithread-safety bug on mingw and MSVC.

* lib/nl_langinfo.c (ctype_codeset, rpl_nl_langinfo): Use a
stack-allocated buffer to assemble each result and different static
buffers to return it.
* tests/test-nl_langinfo-mt.c: New file.
* modules/nl_langinfo-tests (Files): Add it.
(Depends-on): Add thread, nanosleep.
(Makefile.am): Build test-nl_langinfo-mt test.

5 years agolanginfo: Document more details.
Bruno Haible [Tue, 17 Dec 2019 11:21:07 +0000 (12:21 +0100)]
langinfo: Document more details.

* doc/posix-headers/langinfo.texi: List platform details.
* doc/posix-functions/nl_langinfo.texi: Likewise.

5 years agombsinit: Fix compilation error in mingw-w64 7.0 with _UCRT defined.
Bruno Haible [Tue, 17 Dec 2019 09:35:05 +0000 (10:35 +0100)]
mbsinit: Fix compilation error in mingw-w64 7.0 with _UCRT defined.

Reported by Tom Kacvinsky <tom.kacvinsky@vector.com>
and Martin Storsjö <martin@martin.st>
in <https://savannah.gnu.org/bugs/?57406>.

* lib/mbsinit.c: Accommodate an MSVC-like mbstate_t definition with
mingw.

5 years agoglob: Avoid warning on mingw.
Bruno Haible [Tue, 17 Dec 2019 08:51:22 +0000 (09:51 +0100)]
glob: Avoid warning on mingw.

Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00122.html>.

* lib/glob.c (__stat64): Undefine first.

5 years agoxalloc: tune xzalloc for fresh allocations
Paul Eggert [Tue, 17 Dec 2019 08:49:54 +0000 (00:49 -0800)]
xalloc: tune xzalloc for fresh allocations

* lib/xmalloc.c (xzalloc): Use xcalloc rather than xmalloc+memset,
because when the memory is freshly allocated from the OS via sbrk
or mmap, calloc can avoid doing the memset.

5 years agodfa: new function dfacopysyntax
Paul Eggert [Tue, 17 Dec 2019 08:20:53 +0000 (00:20 -0800)]
dfa: new function dfacopysyntax

* lib/dfa.c (struct dfa): Move syntax member later so
that dfacopysyntax can easily clear earlier members.
(dfacopysyntax): New function, used by Gawk.

5 years agodfa: port _GL_ATTRIBUTE_MALLOC to Gawk
Paul Eggert [Tue, 17 Dec 2019 01:02:31 +0000 (17:02 -0800)]
dfa: port _GL_ATTRIBUTE_MALLOC to Gawk

Gawk does not use Gnulib, and does not define _GL_ATTRIBUTE_MALLOC.
* lib/dfa.h (_GL_ATTRIBUTE_MALLOC): Define to empty
if not already defined.

5 years agodfa: remove one dependency on MB_CUR_MAX
Paul Eggert [Tue, 17 Dec 2019 01:00:18 +0000 (17:00 -0800)]
dfa: remove one dependency on MB_CUR_MAX

* lib/dfa.c (dfamust): No need to refer to MB_CUR_MAX here.

5 years agodfa: remove struct lexer_state.cur_mb_len
Paul Eggert [Mon, 16 Dec 2019 22:38:23 +0000 (14:38 -0800)]
dfa: remove struct lexer_state.cur_mb_len

* lib/dfa.c (struct lexer_state): Remove cur_mb_len member,
as it’s not needed and the code is simpler without it.
All uses removed.

5 years agosetlocale-null: Remove need for -lpthread on musl libc, *BSD, Haiku.
Bruno Haible [Mon, 16 Dec 2019 09:38:37 +0000 (10:38 +0100)]
setlocale-null: Remove need for -lpthread on musl libc, *BSD, Haiku.

Reported by Arnold Robbins <arnold@skeeve.com>.

* lib/setlocale_null.c (c11_threads_in_use, pthread_in_use): New macros,
copied from lib/glthread/lock.h.
(pthread_mutex_lock, pthread_mutex_unlock): Mark as weak.
(setlocale_null_with_lock): If pthread_in_use() is false, use
setlocale_null_unlocked directly.
* m4/threadlib.m4 (gl_WEAK_SYMBOLS): New macro, extracted from
gl_THREADLIB_BODY. Define HAVE_WEAK_SYMBOLS.
(gl_THREADLIB_BODY): Invoke gl_WEAK_SYMBOLS.
* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Invoke gl_WEAK_SYMBOLS.
Set LIB_SETLOCALE_NULL to empty if weak symbols are supported.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Add comment.

5 years agodfa: make dfasyntax thread-safe
Paul Eggert [Mon, 16 Dec 2019 08:32:01 +0000 (00:32 -0800)]
dfa: make dfasyntax thread-safe

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00099.html
* lib/dfa.c: Do not include locale.h.
(struct dfa): Remove simple_locale member.
All uses replaced by localeinfo.simple.
(using_simple_locale): Remove; now present (with some
changes) in localeinfo.c.
(dfasyntax): No need to initialize removed member.

5 years agolocaleinfo: record whether locale is simple
Paul Eggert [Mon, 16 Dec 2019 08:27:15 +0000 (00:27 -0800)]
localeinfo: record whether locale is simple

* lib/localeinfo.c (using_simple_locale): New function,
copied here from lib/dfa.c but with a change: it uses
strcoll for its heuristic, instead of using setlocale.
This lets it be thread-safe.
* lib/localeinfo.h (struct localeinfo): New member ‘simple’.

5 years agoduplocale: Fix multithread-safety bug on AIX.
Bruno Haible [Sun, 15 Dec 2019 22:07:28 +0000 (23:07 +0100)]
duplocale: Fix multithread-safety bug on AIX.

* lib/duplocale.c: Don't include <stdlib.h>.
(rpl_duplocale): Invoke setlocale_null instead of setlocale.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Require gl_FUNC_SETLOCALE_NULL.
Set LIB_DUPLOCALE.
* modules/duplocale (Depends-on): Add setlocale-null.
(Link): New section.
* modules/duplocale-tests (Makefile.am): Link test-duplocale with
$(LIB_DUPLOCALE).

5 years agosetlocale-null: Add tests.
Bruno Haible [Sun, 15 Dec 2019 20:48:05 +0000 (21:48 +0100)]
setlocale-null: Add tests.

* tests/test-setlocale_null.c: New file.
* tests/test-setlocale_null-one.c: New file.
* tests/test-setlocale_null-all.c: New file.
* modules/setlocale-null-tests: New file.

5 years agosetlocale-null: New module.
Bruno Haible [Sun, 15 Dec 2019 20:39:55 +0000 (21:39 +0100)]
setlocale-null: New module.

* lib/locale.in.h (SETLOCALE_NULL_MAX, SETLOCALE_NULL_ALL_MAX,
setlocale_null): New declarations.
* lib/setlocale_null.c: New file.
* lib/setlocale-lock.c: New file.
* m4/threadlib.m4 (gl_PTHREADLIB_BODY): Define C macro HAVE_PTHREAD_API.
* m4/setlocale_null.m4: New file.
* m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Initialize
GNULIB_SETLOCALE_NULL.
* modules/locale (Makefile.am): Substitute GNULIB_SETLOCALE_NULL.
* modules/setlocale-null: New file.
* doc/posix-functions/setlocale.texi: Mention the new module.

5 years agolock tests: Skip test when no multithreading is enabled.
Bruno Haible [Sun, 15 Dec 2019 19:05:24 +0000 (20:05 +0100)]
lock tests: Skip test when no multithreading is enabled.

* tests/test-rwlock1.c: Skip the test when no multithreading is enabled.

5 years agolocale, duplocale, localename: Fix last patch.
Bruno Haible [Sat, 14 Dec 2019 13:33:14 +0000 (14:33 +0100)]
locale, duplocale, localename: Fix last patch.

Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00093.html>.

* lib/locale.in.h (HAVE_WORKING_NEWLOCALE, HAVE_WORKING_DUPLOCALE):
Don't define if locale_t does not exist.

5 years agolocale, duplocale, localename: Fix errors if locale_t does not exist.
Bruno Haible [Fri, 13 Dec 2019 10:28:54 +0000 (11:28 +0100)]
locale, duplocale, localename: Fix errors if locale_t does not exist.

Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00078.html>.

* lib/locale.in.h (HAVE_WORKING_NEWLOCALE, HAVE_WORKING_DUPLOCALE): New
macros.
* tests/test-locale.c: Test HAVE_WORKING_NEWLOCALE instead of
HAVE_NEWLOCALE.
* tests/test-localename.c: Likewise.
* tests/test-duplocale.c: Test HAVE_WORKING_DUPLOCALE instead of
HAVE_DUPLOCALE.
* tests/test-locale-c++.cc: Likewise.

5 years agowcstok: Fix test failure on HP-UX.
Bruno Haible [Fri, 13 Dec 2019 07:51:11 +0000 (08:51 +0100)]
wcstok: Fix test failure on HP-UX.

* m4/wcstok.m4 (gl_FUNC_WCSTOK): Set REPLACE_WCSTOK to 1 on HP-UX.
* doc/posix-functions/wcstok.texi: Mention the HP-UX bug.

5 years agostrtod, strtold tests: Avoid test failure on AIX 7.2.
Bruno Haible [Thu, 12 Dec 2019 23:19:56 +0000 (00:19 +0100)]
strtod, strtold tests: Avoid test failure on AIX 7.2.

* tests/test-strtod1.c (main): Allow implementations in which ',' and
'.' both are radix characters.
* tests/test-strtold1.c (main): Likewise.

5 years agodfa: prefer ptrdiff_t for API, too
Paul Eggert [Thu, 12 Dec 2019 22:11:06 +0000 (14:11 -0800)]
dfa: prefer ptrdiff_t for API, too

Also, use ‘idx_t’ for ptrdiff_t values that must be nonnegative,
but do this only for internal use for now.
* NEWS: Mention the API change.
* lib/dfa.c (idx_t, IDX_MAX): New type and max value, for internal
use for now.  Use them instead of ptrdiff_t and PTRDIFF_MAX for
values known to be nonnegative.
(dfaparse, dfaexec_mb, dfaexec_sb, dfaexec_noop, dfaexec):
Prefer idx_t or ptrdiff_t to size_t for API.
* lib/dfa.h (dfaparse, dfacomp, dfaexec):
Prefer ptrdiff_t to size_t for API.

5 years agostdalign: port to xlclang 16.01
Paul Eggert [Thu, 12 Dec 2019 18:16:13 +0000 (10:16 -0800)]
stdalign: port to xlclang 16.01

Problem reportd by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00064.html
* lib/stdalign.in.h (_Alignas): Do not use __attribute__
((__aligned__ (...))) with xlclang, as a top-level
‘char __attribute__ ((__aligned__ (8))) c;’ does not work with
xlclang version 16.01.0000.0001; the alignment directive is ignored.

5 years agoduplocale: Fix test failure on AIX 7.2 with xlclang.
Bruno Haible [Thu, 12 Dec 2019 16:52:50 +0000 (17:52 +0100)]
duplocale: Fix test failure on AIX 7.2 with xlclang.

* lib/duplocale.c: Include <stdlib.h>.
(rpl_duplocale): Use a heap-allocated copy of the first setlocale return
value.

5 years agostddef: Document the AIX xlc issue.
Bruno Haible [Thu, 12 Dec 2019 16:04:02 +0000 (17:04 +0100)]
stddef: Document the AIX xlc issue.

* doc/posix-headers/stddef.texi: Document the NULL issue with AIX xlc.

5 years agoduplocale: Don't attempt to override if locale_t does not exist.
Bruno Haible [Thu, 12 Dec 2019 12:52:50 +0000 (13:52 +0100)]
duplocale: Don't attempt to override if locale_t does not exist.

Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00039.html>.

* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): If locale_t does not exist, set
HAVE_DUPLOCALE to 0.

5 years agowcwidth: Avoid test failure on AIX 7.2.
Bruno Haible [Thu, 12 Dec 2019 12:02:28 +0000 (13:02 +0100)]
wcwidth: Avoid test failure on AIX 7.2.

* tests/test-wcwidth.c (main): Don't fail if wcwidth(0x200B) is
negative.
* doc/posix-functions/wcwidth.texi: Mention the AIX issue.

5 years agoilogbl: Work around Cygwin bug.
Bruno Haible [Thu, 12 Dec 2019 11:38:40 +0000 (12:38 +0100)]
ilogbl: Work around Cygwin bug.

* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test whether ilogbl(0.0L) is
correct.
* doc/posix-functions/ilogbl.texi: Mention the Cygwin bug.

5 years agostrtold: Work around Cygwin bug.
Bruno Haible [Thu, 12 Dec 2019 10:07:49 +0000 (11:07 +0100)]
strtold: Work around Cygwin bug.

* m4/strtold.m4 (gl_FUNC_STRTOLD): Add test for the underflow problem.
If it is present, define STRTOLD_HAS_UNDERFLOW_BUG.
* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Set to 0 if
STRTOLD_HAS_UNDERFLOW_BUG is defined.
* doc/posix-functions/strtold.texi: Mention the Cygwin bug.

5 years agostrtold: Fix autoconf test.
Bruno Haible [Thu, 12 Dec 2019 09:07:40 +0000 (10:07 +0100)]
strtold: Fix autoconf test.

* m4/strtold.m4 (gl_FUNC_STRTOLD): Test strtold, not strtod.

5 years agofsync tests: Skip test that is known to fail.
Bruno Haible [Thu, 12 Dec 2019 01:52:11 +0000 (02:52 +0100)]
fsync tests: Skip test that is known to fail.

* doc/posix-functions/fsync.texi: Update list of platforms.
* tests/test-fsync.c (main): Skip test with read-only file descriptors
that is known to fail on AIX and Cygwin.

5 years agogetaddrinfo: Fix calling convention in 32-bit mode on native Windows.
Bruno Haible [Thu, 12 Dec 2019 01:43:07 +0000 (02:43 +0100)]
getaddrinfo: Fix calling convention in 32-bit mode on native Windows.

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Test whether getaddrinfo has a
non-POSIX signature. If so, set REPLACE_GETADDRINFO. Define
HAVE_GETADDRINFO as a C macro.
* lib/netdb.in.h (getaddrinfo, freeaddrinfo): If REPLACE_GETADDRINFO,
declare as replacement functions.
* lib/getaddrinfo.c (getaddrinfo, freeaddrinfo): If HAVE_GETADDRINFO,
define as no-op overrides.
* m4/netdb_h.m4 (gl_NETDB_H_DEFAULTS): Initialize REPLACE_GETADDRINFO.
* modules/netdb (Makefile.am): Substitute REPLACE_GETADDRINFO.
* modules/getaddrinfo (Depends-on, configure.ac): Test
REPLACE_GETADDRINFO.
* doc/posix-functions/getaddrinfo.texi: Mention calling convention
problem.
* doc/posix-functions/freeaddrinfo.texi: Mention header file and calling
convention problems.

5 years agodfa: prefer signed integers for internals
Paul Eggert [Wed, 11 Dec 2019 23:08:35 +0000 (15:08 -0800)]
dfa: prefer signed integers for internals

Signed integers can be checked more easily for integer overflow.
* lib/dfa.c (position, struct lexer_state, struct parser_state)
(struct dfa, mbs_to_wchar, fetch_wc, parse_bracket_exp)
(struct lexptr, lex, addtok_mb, add_utf8_anychar, atom)
(nsubtoks, copytoks, closure, alloc_position_set, delete)
(replace, state_index, epsclosure, charclass_context)
(state_separate_contexts, merge_nfa_state, dfaoptimize)
(dfaanalyze, build_state, dfaexec_main, dfa_supported)
(maybe_disable_superset_dfa, dfassbuild, dfafree, enlist)
(comsubs, inboth, allocmust):
Prefer a signed to an unsigned integer when calculating indexes,
unless the integer is part of the external API (a bigger deal,
and to be done later).

5 years agodfa: fix index overflow
Paul Eggert [Wed, 11 Dec 2019 21:44:03 +0000 (13:44 -0800)]
dfa: fix index overflow

* lib/dfa.c (compare): Avoid integer overflow when analyzing
very large regular expressions.

5 years agodfa: update commentary for previous change
Paul Eggert [Wed, 11 Dec 2019 21:40:01 +0000 (13:40 -0800)]
dfa: update commentary for previous change

* NEWS: Mention the change.
* lib/dfa.c, lib/dfa.h (dfaparse, dfamust, dfacomp): Update comments.

5 years agodfa: separate parse and compile phase
Norihiro Tanaka [Wed, 11 Dec 2019 20:53:09 +0000 (12:53 -0800)]
dfa: separate parse and compile phase

‘dfamust’ must be called after parsing and before tokens are
reordered, but both are executed in the compilation phase.
Token reordering was introduced in Gnulib commit
2018-10-22T15:01:08Z!noritnk@kcn.ne.jp
(5c7a0371823876cca7a1347fa09ca26bbbff0c98).
* lib/dfa.c (dfaparse): Change it to global function.
(dfacomp): If first argument is NULL, skip parse.
* lib/dfa.h: (dfaparse): Add a prototype.

5 years agounistd tests: Fix link error on MSVC.
Bruno Haible [Wed, 11 Dec 2019 11:51:40 +0000 (12:51 +0100)]
unistd tests: Fix link error on MSVC.

* modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ against
$(LIB_GETLOGIN).

5 years agodoc: Document that ISO C or POSIX substitutes are supported in C++ mode.
Bruno Haible [Wed, 11 Dec 2019 11:36:50 +0000 (12:36 +0100)]
doc: Document that ISO C or POSIX substitutes are supported in C++ mode.

* doc/gnulib-intro.texi (Various Kinds of Modules): Document that ISO C
and POSIX substitutes are supported in C++ mode.
* NEWS: Likewise.

5 years agostddef: Fix compilation error in C++ mode on MSVC.
Bruno Haible [Wed, 11 Dec 2019 08:48:53 +0000 (09:48 +0100)]
stddef: Fix compilation error in C++ mode on MSVC.

* lib/stddef.in.h (max_align_t): With MSVC in C++ mode, don't define it;
instead, include <cstddef>.

5 years agounistd: Fix compilation error in C++ mode on MSVC.
Bruno Haible [Wed, 11 Dec 2019 09:46:16 +0000 (10:46 +0100)]
unistd: Fix compilation error in C++ mode on MSVC.

* lib/unistd.in.h: Don't do include[_next] <unistd.h> if the platform
does not have <unistd.h>.

5 years agolocale: Fix compilation error in C++ mode on MSVC.
Bruno Haible [Wed, 11 Dec 2019 09:05:27 +0000 (10:05 +0100)]
locale: Fix compilation error in C++ mode on MSVC.

* m4/locale_h.m4 (gl_LOCALE_H): Don't set REPLACE_STRUCT_LCONV on MSVC.
* lib/locale.in.h (int_p_cs_precedes, int_p_sign_posn,
int_p_sep_by_space, int_n_cs_precedes, int_n_sign_posn,
int_n_sep_by_space): Define as macros on MSVC.

5 years agowchar: Fix compilation error in C++ mode on MSVC.
Bruno Haible [Wed, 11 Dec 2019 08:54:35 +0000 (09:54 +0100)]
wchar: Fix compilation error in C++ mode on MSVC.

* lib/wchar.in.h (mbstate_t): Don't override on MSVC.

5 years agopthread-thread: Fix compilation error in C++ mode on MSVC.
Bruno Haible [Wed, 11 Dec 2019 08:37:55 +0000 (09:37 +0100)]
pthread-thread: Fix compilation error in C++ mode on MSVC.

* lib/pthread.in.h (pthread_exit): Don't use _Noreturn in the
_GL_CXXALIAS_RPL invocation.

5 years agoautoupdate
Karl Berry [Tue, 10 Dec 2019 16:44:42 +0000 (08:44 -0800)]
autoupdate

5 years agoautoupdate
Karl Berry [Mon, 9 Dec 2019 16:45:26 +0000 (08:45 -0800)]
autoupdate

5 years agoFix compilation errors in C++ mode on Haiku.
Bruno Haible [Mon, 9 Dec 2019 02:02:08 +0000 (03:02 +0100)]
Fix compilation errors in C++ mode on Haiku.

* lib/stdio.in.h (vdprintf): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
* lib/spawn.in.h (posix_spawnattr_getschedpolicy,
posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam,
posix_spawnattr_setschedparam): Likewise.
* lib/stdlib.in.h (random, initstate_r, setstate_r): Use
_GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS.
* lib/unistd.in.h (usleep): Likewise.

5 years agoFix compilation errors in 32-bit C++ mode on HP-UX 11/ia64.
Bruno Haible [Mon, 9 Dec 2019 01:12:53 +0000 (02:12 +0100)]
Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64.

* m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE): New macro.
* modules/fseeko (configure.ac-early): Require it instead of
AC_FUNC_FSEEKO.
* modules/ftello (configure.ac-early): Likewise.
* modules/fflush (configure.ac-early): Likewise.

5 years agoFix compilation error in C++ mode on HP-UX 11.
Bruno Haible [Sun, 8 Dec 2019 20:49:32 +0000 (21:49 +0100)]
Fix compilation error in C++ mode on HP-UX 11.

* lib/unistd.in.h (getpagesize): Declare on HP-UX.
* doc/glibc-functions/getpagesize.texi: Mention the HP-UX problem.

5 years agoFix compilation errors on HP-UX 11/ia64.
Bruno Haible [Sun, 8 Dec 2019 16:35:49 +0000 (17:35 +0100)]
Fix compilation errors on HP-UX 11/ia64.

* lib/math.in.h (copysignf, fmaf, fma): Undefine before
_GL_FUNCDECL_SYS.

5 years agoFix compilation error in C++ mode on OpenBSD.
Bruno Haible [Sun, 8 Dec 2019 15:34:31 +0000 (16:34 +0100)]
Fix compilation error in C++ mode on OpenBSD.

* lib/signal.in.h (signal): Declare on OpenBSD.

5 years agomath tests: Don't fail if isfinite, isinf, isnan, signbit is a macro.
Bruno Haible [Sun, 8 Dec 2019 14:01:54 +0000 (15:01 +0100)]
math tests: Don't fail if isfinite, isinf, isnan, signbit is a macro.

* tests/test-math-c++.cc (isfinite, isinf, isnan, signbit): Use #warning
instead of #error.

5 years agoFix compilation errors in C++ mode on FreeBSD.
Bruno Haible [Sun, 8 Dec 2019 12:10:23 +0000 (13:10 +0100)]
Fix compilation errors in C++ mode on FreeBSD.

* lib/pthread.in.h (pthread_exit): Remove _Noreturn from prototype.
* tests/test-pthread-c++.cc (GNULIB_NAMESPACE::pthread_exit): Likewise.
* lib/threads.in.h (thrd_exit): Likewise.
* tests/test-threads-c++.cc (GNULIB_NAMESPACE::thrd_exit): Likewise.

5 years agoFix compilation errors in C++ mode on macOS and FreeBSD.
Bruno Haible [Sun, 8 Dec 2019 11:58:13 +0000 (12:58 +0100)]
Fix compilation errors in C++ mode on macOS and FreeBSD.

* lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS
or FreeBSD with clang, use the approach without C preprocessor macro.

5 years agoFix compilation errors in C++ mode on AIX with xlclang++.
Bruno Haible [Sat, 7 Dec 2019 17:49:45 +0000 (18:49 +0100)]
Fix compilation errors in C++ mode on AIX with xlclang++.

Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.

* lib/wchar.in.h (mbstate_t): Don't override on AIX.

5 years agoDocument compilation error in C++ mode on NetBSD 8.0.
Bruno Haible [Sat, 7 Dec 2019 14:45:32 +0000 (15:45 +0100)]
Document compilation error in C++ mode on NetBSD 8.0.

* doc/posix-headers/monetary.texi: Mention the NetBSD bug.

5 years agoFix compilation errors in C++ mode on Solaris 10.
Bruno Haible [Sat, 7 Dec 2019 14:13:57 +0000 (15:13 +0100)]
Fix compilation errors in C++ mode on Solaris 10.

* m4/stdbool.m4 (AM_STDBOOL_H): Require AC_CANONICAL_HOST. Set STDBOOL_H
to non-empty on Solaris with a non-GCC compiler.
* doc/posix-headers/stdbool.texi: Mention the Solaris issue.

5 years agoReword NEWS entry.
Bruno Haible [Sat, 7 Dec 2019 09:47:36 +0000 (10:47 +0100)]
Reword NEWS entry.

* NEWS: Reword the latest NEWS entry.

5 years agoMove xstrtol_fatal to a new xstrtol-error module
Pino Toscano [Thu, 5 Dec 2019 15:18:35 +0000 (16:18 +0100)]
Move xstrtol_fatal to a new xstrtol-error module

The xstrtol module provides a xstrtol_fatal function which uses other
modules suitable mostly for command line handling (e.g. gettext,
getopt), and that are completely unused when using only xstrto*
functions. Furthermore, xstrtol_fatal is used only in the xstrtol-tests
(within gnulib itself).

As solution, move the xstrtol_fatal to a new xstrtol-error module,
making xstrtol-tests depend on it. Since the prototype of xstrtol_fatal
is automatically provided by xstrtol.h, it is very difficult to know
whether anyone is actually using it, so add a note about this in NEWS.

* lib/xstrtol.h: Stop including <getopt.h>.
(xstrtol_fatal): Move ...
* lib/xstrtol-error.h: ... here.  New file.
* lib/xstrtol-error.c: Include xstrtol-error.h instead of xstrtol.h.
* tests/test-xstrtol.c: Likewise.
* modules/xstrtol (Files): Remove lib/xstrtol-error.c.
(Depends-on): Remove exitfail, error, getopt-gnu, and gettext-h.
(Makefile.am): Remove xstrtol-error.c from lib_SOURCES.
* modules/xstrtol-error: New file.
* modules/xstrtol-tests (Depends-on): Add xstrtol-error.
* MODULES.html.sh: Add xstrtol-error.
* NEWS: Document the change.

5 years agonstrftime: better width support for %N, %z
Paul Eggert [Fri, 6 Dec 2019 22:48:04 +0000 (14:48 -0800)]
nstrftime: better width support for %N, %z

* lib/nstrftime.c (width_add, width_add1, width_cpy):
New macros, which generalize ‘add’, ‘add1’, ‘cpy’ by adding
a new WIDTH parameter.
(add, add1, cpy): Use these macros.
(width_add): Do not treat digits == 0 as a special case,
do not pad if padding is ‘-’, and do not use a negative width.
(__strftime_internal): Redo formatting of nanoseconds and numeric
timezones to avoid buffer misuse in unusual cases, and so that
widths make more sense.  Add support for widths greater than 9 to
the %N format; they are zero filled on the right.
* tests/test-nstrftime.c (posixtm_test): Add a %12N test.

5 years agoFix compilation errors in C++ mode on Solaris 10 and Solaris 11.
Bruno Haible [Thu, 5 Dec 2019 21:25:04 +0000 (22:25 +0100)]
Fix compilation errors in C++ mode on Solaris 10 and Solaris 11.

* m4/isfinite.m4 (gl_ISFINITE): Require AC_CANONICAL_HOST. On Solaris,
set REPLACE_ISFINITE to 1.
* m4/isinf.m4 (gl_ISINF): Require AC_CANONICAL_HOST. On Solaris, set
REPLACE_ISINF to 1.
* m4/signbit.m4 (gl_SIGNBIT): On Solaris, set REPLACE_SIGNBIT to 1.
* lib/pthread.in.h (pthread_create, pthread_once, pthread_key_create):
Use _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS.
* lib/threads.in.h (call_once): Likewise.
* lib/iconv.in.h (iconv): Likewise.

5 years agowchar: Add more C++ tests.
Bruno Haible [Thu, 5 Dec 2019 08:18:13 +0000 (09:18 +0100)]
wchar: Add more C++ tests.

Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.

* tests/test-wchar-c++3.cc: New file.
* modules/wchar-c++-tests (Files): Add it.
(Makefile.am): Compile it.

5 years agoAdd more C++ tests.
Bruno Haible [Thu, 5 Dec 2019 08:11:45 +0000 (09:11 +0100)]
Add more C++ tests.

assert-h: Add C++ tests.
* tests/test-assert-h-c++.cc: New file.
* tests/test-assert-h-c++2.cc: New file.
* modules/assert-h-c++-tests: New file.
* modules/assert-h-tests: New file.

ctype: Add C++ tests.
* tests/test-ctype-c++.cc: New file.
* tests/test-ctype-c++2.cc: New file.
* modules/ctype-c++-tests: New file.
* modules/ctype-tests (Depends-on): Add ctype-c++-tests.

errno: Add C++ tests.
* tests/test-errno-c++.cc: New file.
* tests/test-errno-c++2.cc: New file.
* modules/errno-c++-tests: New file.
* modules/errno-tests (Depends-on): Add errno-c++-tests.

float: Add C++ tests.
* tests/test-float-c++.cc: New file.
* tests/test-float-c++2.cc: New file.
* modules/float-c++-tests: New file.
* modules/float-tests (Depends-on): Add float-c++-tests.

inttypes: Add more C++ tests.
* tests/test-inttypes-c++2.cc: New file.
* modules/inttypes-c++-tests (Files): Add it.
(Makefile.am): Compile it.

limits-h: Add C++ tests.
* tests/test-limits-h-c++.cc: New file.
* tests/test-limits-h-c++2.cc: New file.
* modules/limits-h-c++-tests: New file.
* modules/limits-h-tests (Depends-on): Add limits-h-c++-tests.

stdarg: Add C++ tests.
* tests/test-stdarg-c++.cc: New file.
* tests/test-stdarg-c++2.cc: New file.
* modules/stdarg-c++-tests: New file.
* modules/stdarg-tests: New file.

stdbool: Add C++ tests.
* tests/test-stdbool-c++.cc: New file.
* tests/test-stdbool-c++2.cc: New file.
* modules/stdbool-c++-tests: New file.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.

stddef: Add C++ tests.
* tests/test-stddef-c++.cc: New file.
* tests/test-stddef-c++2.cc: New file.
* modules/stddef-c++-tests: New file.
* modules/stddef-tests (Depends-on): Add stddef-c++-tests.

stdint: Add C++ tests.
* tests/test-stdint-c++.cc: New file.
* tests/test-stdint-c++2.cc: New file.
* modules/stdint-c++-tests: New file.
* modules/stdint-tests (Depends-on): Add stdint-c++-tests.

wchar: Add more C++ tests.
* tests/test-wchar-c++2.cc: New file.
* modules/wchar-c++-tests (Files): Add it.
(Makefile.am): Compile it.

wctype-h: Add more C++ tests.
* tests/test-wctype-h-c++2.cc: New file.
* modules/wctype-h-c++-tests (Files): Add it.
(Makefile.am): Compile it.

5 years agoFix compilation errors in C++ mode with xlclang++ on AIX.
Bruno Haible [Thu, 5 Dec 2019 08:50:01 +0000 (09:50 +0100)]
Fix compilation errors in C++ mode with xlclang++ on AIX.

* lib/pthread.in.h (pthread_exit): Add comment.
* lib/threads.in.h (thrd_exit): Likewise.

5 years agoFix compilation errors in C++ mode with xlclang++ on AIX.
Bruno Haible [Thu, 5 Dec 2019 02:18:42 +0000 (03:18 +0100)]
Fix compilation errors in C++ mode with xlclang++ on AIX.

* lib/math.in.h (expm1l, fmal, remainderl, roundl): Don't redeclare in
C++ mode on AIX.
(isfinite, signbit): In C++ mode on AIX with clang, use the approach
without C preprocessor macro.
* lib/pthread.in.h (pthread_exit): Use _GL_CXXALIAS_SYS_CAST instead of
_GL_CXXALIAS_SYS.
* lib/threads.in.h (thrd_exit): Likewise.

5 years agoFix compilation error in C++ mode on Solaris 11 OpenIndiana.
Bruno Haible [Wed, 4 Dec 2019 11:20:44 +0000 (12:20 +0100)]
Fix compilation error in C++ mode on Solaris 11 OpenIndiana.

* lib/wchar.in.h (wcsnrtombs): Force declaration in C++ mode on Solaris.
* doc/posix-functions/wcsnrtombs.texi: Mention the issue.

5 years agoDisable more _GL_CXXALIASWARN on all platforms other than glibc systems.
Bruno Haible [Wed, 4 Dec 2019 03:49:58 +0000 (04:49 +0100)]
Disable more _GL_CXXALIASWARN on all platforms other than glibc systems.

* lib/wchar.in.h (wcsnrtombs, wcwidth, wcswidth): Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
* lib/wctype.in.h (iswalnum, iswalpha, iswcntrl, iswdigit, iswgraph,
iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit, wctype,
iswctype, towlower, towupper): Likewise.

5 years agoAvoid hassles caused by [[noreturn]] in C++.
Bruno Haible [Tue, 3 Dec 2019 08:19:17 +0000 (09:19 +0100)]
Avoid hassles caused by [[noreturn]] in C++.

Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00010.html>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Disable the use of [[noreturn]].
* lib/_Noreturn.h: Likewise.

5 years agoFix mistakes in --enable-threads=isoc fixes from 2019-12-01.
Bruno Haible [Tue, 3 Dec 2019 03:54:53 +0000 (04:54 +0100)]
Fix mistakes in --enable-threads=isoc fixes from 2019-12-01.

* m4/pthread-mutex.m4 (gl_PTHREAD_MUTEX): Use LIBPMULTITHREAD, not
LIBMULTITHREAD.
* m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Likewise.
* m4/pthread-thread.m4 (gl_PTHREAD_THREAD): Likewise.
* m4/timer_time.m4 (gl_TIMER_TIME): Likewise. Require gl_PTHREADLIB, not
gl_THREADLIB.
* modules/timer-time (Depends-on): Add pthread-h. Remove threadlib.

5 years agoFix some more link errors with --enable-threads=isoc.
Bruno Haible [Tue, 3 Dec 2019 02:49:30 +0000 (03:49 +0100)]
Fix some more link errors with --enable-threads=isoc.

* modules/pthread-mutex (Depends-on): Test $gl_threads_api differently.
* modules/pthread-rwlock (Depends-on): Likewise.

5 years agoFix link errors with --enable-threads=posix on AIX.
Bruno Haible [Tue, 3 Dec 2019 01:04:23 +0000 (02:04 +0100)]
Fix link errors with --enable-threads=posix on AIX.

* modules/string-c++-tests (Makefile.am): Link the test-string-c++
program with $(LIBTHREAD).
* modules/wchar-c++-tests (Makefile.am): Link the test-wchar-c++
program with $(LIBTHREAD).

5 years agoFix link errors with --enable-threads=posix on AIX.
Bruno Haible [Mon, 2 Dec 2019 22:18:20 +0000 (23:18 +0100)]
Fix link errors with --enable-threads=posix on AIX.

* modules/mbrtowc (Link): New section.
* modules/acl (Link): Likewise.
* modules/argmatch (Link): Likewise.
* modules/backup-rename (Link): Likewise.
* modules/backupfile (Link): Likewise.
* modules/closein (Link): Likewise.
* modules/closeout (Link): Likewise.
* modules/copy-file (Link): Likewise.
* modules/csharpcomp (Link): Likewise.
* modules/csharpexec (Link): Likewise.
* modules/dfa (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/fnmatch (Link): Likewise.
* modules/fnmatch-gnu (Link): Likewise.
* modules/fnmatch-posix (Link): Likewise.
* modules/glob (Link): Likewise.
* modules/human (Link): Likewise.
* modules/javacomp (Link): Likewise.
* modules/javaexec (Link): Likewise.
* modules/javaversion (Link): Likewise.
* modules/mbfile (Link): Likewise.
* modules/mbiter (Link): Likewise.
* modules/mbmemcasecmp (Link): Likewise.
* modules/mbmemcasecoll (Link): Likewise.
* modules/mbrlen (Link): Likewise.
* modules/mbscasecmp (Link): Likewise.
* modules/mbscasestr (Link): Likewise.
* modules/mbschr (Link): Likewise.
* modules/mbscspn (Link): Likewise.
* modules/mbsinit (Link): Likewise.
* modules/mbslen (Link): Likewise.
* modules/mbsncasecmp (Link): Likewise.
* modules/mbsnlen (Link): Likewise.
* modules/mbsnrtowcs (Link): Likewise.
* modules/mbspbrk (Link): Likewise.
* modules/mbspcasecmp (Link): Likewise.
* modules/mbsrchr (Link): Likewise.
* modules/mbsrtowcs (Link): Likewise.
* modules/mbssep (Link): Likewise.
* modules/mbsspn (Link): Likewise.
* modules/mbsstr (Link): Likewise.
* modules/mbstok_r (Link): Likewise.
* modules/mbswidth (Link): Likewise.
* modules/mbuiter (Link): Likewise.
* modules/mkdir-p (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/quote (Link): Likewise.
* modules/quotearg (Link): Likewise.
* modules/quotearg-simple (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/rpmatch (Link): Likewise.
* modules/sh-quote (Link): Likewise.
* modules/system-quote (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/unistdio/ulc-asnprintf (Link): Likewise.
* modules/unistdio/ulc-fprintf (Link): Likewise.
* modules/unistdio/ulc-vasnprintf (Link): Likewise.
* modules/unistdio/ulc-vasprintf (Link): Likewise.
* modules/unistdio/ulc-vfprintf (Link): Likewise.
* modules/unistdio/ulc-vsnprintf (Link): Likewise.
* modules/unistdio/ulc-vsprintf (Link): Likewise.
* modules/xfreopen (Link): Likewise.
* modules/xmemcoll (Link): Likewise.
* modules/yesno (Link): Likewise.
* modules/acl-tests (Makefile.am): Link the programs with $(LIBTHREAD).
* modules/argmatch-tests (Makefile.am): Likewise.
* modules/closein-tests (Makefile.am): Likewise.
* modules/copy-file-tests (Makefile.am): Likewise.
* modules/dfa-tests (Makefile.am): Likewise.
* modules/fnmatch-tests (Makefile.am): Likewise.
* modules/glob-tests (Makefile.am): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Likewise.
* modules/mbmemcasecoll-tests (Makefile.am): Likewise.
* modules/mbrtowc-tests (Makefile.am): Likewise.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsinit-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbsnrtowcs-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsrtowcs-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/quotearg-tests (Makefile.am): Likewise.
* modules/quotearg-simple-tests (Makefile.am): Likewise.
* modules/readtokens-tests (Makefile.am): Likewise.
* modules/regex-quote-tests (Makefile.am): Likewise.
* modules/sh-quote-tests (Makefile.am): Likewise.
* modules/system-quote-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise.
* modules/yesno-tests (Makefile.am): Likewise.

5 years agoSimplify link sections.
Bruno Haible [Mon, 2 Dec 2019 10:07:36 +0000 (11:07 +0100)]
Simplify link sections.

* modules/threadlib (Link): Stop mentioning LTLIBTHREAD.
* modules/lock (Link): Likewise.
* modules/cond (Link): Likewise.
* modules/tls (Link): Likewise.
* modules/yield (Link): Likewise.
* modules/regex (Link): Likewise.
* modules/localename (Link): Likewise.
* modules/unicase/locale-language (Link): Likewise.
* modules/thread (Link): Stop mentioning LTLIBMULTITHREAD.

5 years agothread tests: Avoid link error with --enable-threads=isoc+posix on AIX.
Bruno Haible [Mon, 2 Dec 2019 09:59:21 +0000 (10:59 +0100)]
thread tests: Avoid link error with --enable-threads=isoc+posix on AIX.

* tests/test-thread_self.c (main): Disable test on AIX.

5 years agopthread-h: Fix link errors with --enable-threads=isoc on AIX.
Bruno Haible [Mon, 2 Dec 2019 01:39:38 +0000 (02:39 +0100)]
pthread-h: Fix link errors with --enable-threads=isoc on AIX.

* m4/threadlib.m4 (gl_ANYTHREADLIB_EARLY): New macro, extracted from
gl_THREADLIB_EARLY_BODY.
(gl_THREADLIB_EARLY_BODY): Invoke it.
(gl_PTHREADLIB_BODY): New macro, extracted from gl_THREADLIB_BODY.
(gl_THREADLIB_BODY): Invoke it.
(gl_PTHREADLIB): New macro.
* m4/pthread_h.m4 (gl_PTHREAD_H): Require gl_PTHREADLIB. Require
gl_THREADLIB and test $gl_threads_api only if module 'threadlib' is
present. Define LIB_PTHREAD using LIBPMULTITHREAD, not LIBMULTITHREAD.
* modules/pthread-h (Files): Add threadlib.m4.
(Depends-on): Remove threadlib.
(configure.ac-early): Invoke gl_ANYTHREADLIB_EARLY. Don't set _REENTRANT
and _THREAD_SAFE here.
(Link): Use LIBPTHREAD, not LIBTHREAD.
* modules/pthread-thread (Link): Use LIBPMULTITHREAD, not
LIBMULTITHREAD.
* modules/pthread-once (Link): Likewise.
* modules/pthread-mutex (Link): Likewise.
* modules/pthread-rwlock (Link): Likewise.
* modules/pthread-cond (Link): Likewise.
* modules/pthread-tss (Link): Likewise.
* modules/pthread-spin (Link): Likewise.
* modules/pthread (Link): Likewise.
* modules/pthread-h-c++-tests (test_pthread_c___LDADD): Likewise.
* modules/pthread-thread-tests (test_pthread_thread_LDADD): Likewise.
* modules/pthread-once-tests (test_pthread_once1_LDADD,
test_pthread_once2_LDADD): Likewise.
* modules/pthread-mutex-tests (test_pthread_mutex_LDADD): Likewise.
* modules/pthread-rwlock-tests (test_pthread_rwlock_LDADD): Likewise.
* modules/pthread-cond-tests (test_pthread_cond_LDADD): Likewise.
* modules/pthread-tss-tests (test_pthread_tss_LDADD): Likewise.

5 years agocond: State linking requirements.
Bruno Haible [Sun, 1 Dec 2019 16:23:12 +0000 (17:23 +0100)]
cond: State linking requirements.

* modules/cond (Link): New section.

5 years agothreadlib: Remove unnecessary file (left over from 2019-07-06).
Bruno Haible [Sun, 1 Dec 2019 16:10:11 +0000 (17:10 +0100)]
threadlib: Remove unnecessary file (left over from 2019-07-06).

* modules/threadlib (Files): Remove config.rpath.

5 years agoEdit gnulib-tool.py.TODO.
Bruno Haible [Sat, 30 Nov 2019 14:03:46 +0000 (15:03 +0100)]
Edit gnulib-tool.py.TODO.

* gnulib-tool.py.TODO: Group related commits.

5 years agoTODO list for gnulib-tool.py.TODO, compared to gnulib-tool.
Bruno Haible [Sat, 30 Nov 2019 12:11:55 +0000 (13:11 +0100)]
TODO list for gnulib-tool.py.TODO, compared to gnulib-tool.

5 years agognulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am.
Tim Rühsen [Sat, 30 Nov 2019 12:04:28 +0000 (13:04 +0100)]
gnulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am.

Reported by Dagobert Michelsen <dam@opencsw.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00086.html>.

* pygnulib/GLModuleSystem.py (getLink): Don't join the parts. Return a
list of strings instead of one string.
* pygnulib/GLEmiter.py (lib_Makefile_am): Adapt accordingly.
* pygnulib/GLImport.py (execute): Likewise.

5 years agoopenpty, forkpty: Fix build error on Solaris 11.4.
Bruno Haible [Wed, 27 Nov 2019 23:34:34 +0000 (00:34 +0100)]
openpty, forkpty: Fix build error on Solaris 11.4.

* m4/pty_h.m4 (gl_PTY_H): Test for termios.h. Look for the declarations
also in <termios.h>.
* m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Look for the declaration
of the function also in <termios.h>.
* doc/glibc-functions/openpty.texi: Mention the Solaris 11.4 problems.
* doc/glibc-functions/forkpty.texi: Likewise.