]> Savannah Git Hosting - gnulib.git/log
gnulib.git
6 years agodoc: Update statement about target platforms.
Bruno Haible [Tue, 18 Sep 2018 19:04:48 +0000 (21:04 +0200)]
doc: Update statement about target platforms.

Reported by Simon Sobisch.

* doc/gnulib-intro.texi (Target Platforms): Update. Mention
restrictions on MSVC versions.

6 years agoposix_spawn tests: Fix link error on 64-bit Cygwin.
Bruno Haible [Tue, 18 Sep 2018 18:18:38 +0000 (20:18 +0200)]
posix_spawn tests: Fix link error on 64-bit Cygwin.

* tests/test-posix_spawn1.c (environ): Remove declaration.
* tests/test-posix_spawn2.c (environ): Likewise.
* tests/test-posix_spawn3.c (environ): Likewise.
* tests/test-posix_spawn4.c (environ): Likewise.
* modules/posix_spawn-tests (Depends-on): Add 'environ'.
* modules/posix_spawnp-tests (Depends-on): Likewise.

6 years agotimespec: new function current_timespec
Paul Eggert [Sun, 16 Sep 2018 21:41:36 +0000 (14:41 -0700)]
timespec: new function current_timespec

* lib/gettime.c (gettime): Prefer clock_gettime to nanotime,
and don’t worry about it failing on a CLOCK_REALTIME arg.
POSIX requires it to succeed and I don’t know of any
counterexamples where the fallbacks would work.
(current_timespec): New function, taken from Emacs.  It is more
convenient than gettime, and can help register allocation.
* lib/timespec.h: Include arg-nonnull.h.
(current_timespec): New declaration.
(gettime, settime): Declare args to be nonnull.
* modules/timespec (Depends-on): Add snippet/arg-nonnull.

6 years agosetlocale: Improve locale handling on macOS 10.12 or newer.
Bruno Haible [Sun, 16 Sep 2018 17:12:44 +0000 (19:12 +0200)]
setlocale: Improve locale handling on macOS 10.12 or newer.

* lib/setlocale.c: Include header files for CoreFoundation. Declare
gl_locale_name_canonicalize.
(libintl_setlocale): Try harder to set a locale for categories LC_CTYPE
and LC_MESSAGES.
* m4/setlocale.m4 (gl_PREREQ_SETLOCALE): Add comment.

6 years agoUpdate list of locale names with scripts on macOS.
Bruno Haible [Sun, 16 Sep 2018 15:14:12 +0000 (17:14 +0200)]
Update list of locale names with scripts on macOS.

* lib/localename.c (gl_locale_name_canonicalize): Update tables to
match Mac OS X 10.13 and recent glibc.

6 years agogettext: Use newer macOS APIs when possible.
Bruno Haible [Sun, 16 Sep 2018 15:08:04 +0000 (17:08 +0200)]
gettext: Use newer macOS APIs when possible.

* m4/intlmacosx.m4 (gt_INTL_MACOSX): Fix variable name.

6 years agogettext: Use newer macOS APIs when possible.
Bruno Haible [Sun, 16 Sep 2018 12:45:15 +0000 (14:45 +0200)]
gettext: Use newer macOS APIs when possible.

* m4/intlmacosx.m4 (gt_INTL_MACOSX): Check for
CFLocaleCopyPreferredLanguages.

6 years agolocalename: Revisit macOS specific code.
Bruno Haible [Sun, 16 Sep 2018 12:42:55 +0000 (14:42 +0200)]
localename: Revisit macOS specific code.

* lib/localename.c (gl_locale_name_default): Reduce code duplication.
Fix comments about Mac OS X versions.

6 years agosetlocale: Improve support for locales not supported by libc.
Bruno Haible [Sun, 16 Sep 2018 01:15:54 +0000 (03:15 +0200)]
setlocale: Improve support for locales not supported by libc.

Reported by Dapeng Gao <peter@dpgao.cc> at
<https://savannah.gnu.org/bugs/?54479>.

* gettext-runtime/intl/setlocale.c: Include <stdio.h>.
(libintl_setlocale): Use a more error-tolerant strategy when the locale
to be set is not supported by libc: Emit warnings instead of failing.

6 years agostrstr, strcasestr: Add workaround against glibc-2.28 bug.
Bruno Haible [Sat, 15 Sep 2018 10:04:03 +0000 (12:04 +0200)]
strstr, strcasestr: Add workaround against glibc-2.28 bug.

Reported by Michael Brunnbauer via Siddhesh Poyarekar and Eric Blake.

* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Set
gl_cv_func_strstr_works_always to 'no' on glibc 2.28.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Set
gl_cv_func_strcasestr_works_always to 'no' on glibc 2.28.
* doc/posix-functions/strstr.texi: Document the glibc 2.28 bug.
* doc/glibc-functions/strcasestr.texi: Likewise.

6 years agodoc: Fix bottom of top-level page.
Bruno Haible [Fri, 14 Sep 2018 10:52:53 +0000 (12:52 +0200)]
doc: Fix bottom of top-level page.

Reported by Akim Demaille <akim.demaille@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00072.html>.

* doc/pastposix-functions/index.texi: Rename node to '_index' in HTML
mode.
* doc/gnulib.texi (Legacy Function Substitutes): Update menu
accordingly.

6 years agoAdd test case from a recent glibc bug.
Bruno Haible [Wed, 12 Sep 2018 21:40:02 +0000 (23:40 +0200)]
Add test case from a recent glibc bug.

* tests/test-strstr.c (main): Add test of long needle.
* tests/test-strcasestr.c (main): Likewise.
* tests/test-c-strstr.c (main): Likewise.
* tests/test-c-strcasestr.c (main): Likewise.
* tests/test-memmem.c (main): Likewise.

6 years agoApply Eric Blake's improvements from 2011-02-25 to more tests.
Bruno Haible [Wed, 12 Sep 2018 19:30:42 +0000 (21:30 +0200)]
Apply Eric Blake's improvements from 2011-02-25 to more tests.

* tests/test-c-strstr.c (main): Add the same tests here as well.

6 years agoApply Jim Meyering's fix from 2015-01-11 to more tests.
Bruno Haible [Wed, 12 Sep 2018 19:27:52 +0000 (21:27 +0200)]
Apply Jim Meyering's fix from 2015-01-11 to more tests.

* tests/test-memmem.c (main): Free haystack.
* tests/test-strcasestr.c (main): Likewise.
* tests/test-c-strcasestr.c (main): Likewise.

6 years agoxstrtol: actually copy the intprops.h line
Paul Eggert [Tue, 11 Sep 2018 19:42:31 +0000 (12:42 -0700)]
xstrtol: actually copy the intprops.h line

6 years agoxstrtol: fix missing-TYPE_SIGNED typo
Paul Eggert [Tue, 11 Sep 2018 19:29:01 +0000 (12:29 -0700)]
xstrtol: fix missing-TYPE_SIGNED typo

* lib/xstrtol.c (TYPE_SIGNED): New macro, duplicating intprops.h.

6 years agotimespec: fix resolution confusion
Paul Eggert [Tue, 11 Sep 2018 01:42:25 +0000 (18:42 -0700)]
timespec: fix resolution confusion

In normal usage, clock resolution is given in seconds, but the
code was mistakenly using inverse seconds and calling it
“resolution”.  Fix this, partly by renaming two identifiers.
The old names will be kept for a bit, to ease transition.
* lib/timespec.h (TIMESPEC_HZ, LOG10_TIMESPEC_HZ):
New constants, replacing TIMESPEC_RESOLUTION and
LOG10_TIMESPEC_RESOLUTION, which are now obsolescent.
All uses changed.

6 years agomktime: simplify in prep for glibc merge
Paul Eggert [Sun, 9 Sep 2018 15:56:15 +0000 (08:56 -0700)]
mktime: simplify in prep for glibc merge

* lib/mktime.c, lib/timegm.c [_LIBC]:
Include mktime-internal.h (a small file just for glibc)
instead of using a typedef.

6 years agointprops: minor clarification of code
Paul Eggert [Sat, 8 Sep 2018 00:13:59 +0000 (17:13 -0700)]
intprops: minor clarification of code

* lib/intprops.h (_GL_BINARY_OP_OVERFLOW):
Use _GL_INT_CONVERT rather than reinventing it.

6 years agoFix a comment.
Bruno Haible [Fri, 7 Sep 2018 21:39:37 +0000 (23:39 +0200)]
Fix a comment.

* tests/test-posix_spawn3.c (parent_main): Fix typo in comment.

6 years agoposix_spawn_file_actions_addchdir: Add tests.
Bruno Haible [Fri, 7 Sep 2018 21:38:53 +0000 (23:38 +0200)]
posix_spawn_file_actions_addchdir: Add tests.

* tests/test-posix_spawn_file_actions_addchdir.c: New file.
* tests/test-posix_spawn4.c: New file.
* modules/posix_spawn_file_actions_addchdir-tests: New file.

6 years agoposix_spawn_file_actions_addchdir: New module.
Bruno Haible [Fri, 7 Sep 2018 21:35:52 +0000 (23:35 +0200)]
posix_spawn_file_actions_addchdir: New module.

Suggested by Eric Blake in
<https://lists.gnu.org/archive/html/bug-findutils/2018-09/msg00007.html>.

* lib/spawn.in.h (posix_spawn_file_actions_addchdir): New declaration.
* lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_chdir' and
union member 'chdir_action'.
* lib/spawn_faction_addchdir.c: New file.
* lib/spawni.c (__spawni): Implement the spawn_do_chdir action.
* lib/spawn_faction_addclose.c: Test REPLACE_POSIX_SPAWN instead of
HAVE_WORKING_POSIX_SPAWN.
* lib/spawn_faction_adddup2.c: Likewise.
* lib/spawn_faction_addopen.c: Likewise.
* m4/posix_spawn_faction_addchdir.m4: New file.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module
'posix_spawn_file_actions_addchdir' is present and whether
posix_spawn_file_actions_addchdir_np exists. Define REPLACE_POSIX_SPAWN
instead of HAVE_WORKING_POSIX_SPAWN.
* m4/spawn_h.m4 (gl_SPAWN_H): Test whether
posix_spawn_file_actions_addchdir is declared.
(gl_SPAWN_H_DEFAULTS): Initialize
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR,
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR,
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR.
* modules/spawn (Makefile.am): Substitute
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR,
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR,
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR.
* modules/posix_spawn_file_actions_addchdir: New file.
* modules/posix_spawn_file_actions_addclose (Depends-on,
configure.ac): Test also REPLACE_POSIX_SPAWN.
* modules/posix_spawn_file_actions_adddup2 (Depends-on,
configure.ac): Likewise.
* modules/posix_spawn_file_actions_addopen (Depends-on,
configure.ac): Likewise.
* tests/test-spawn-c++.cc (posix_spawn_file_actions_addchdir): Check
signature.
* doc/posix-functions/posix_spawn.texi: Mention the new module.
* doc/posix-functions/posix_spawnp.texi: Likewise.

6 years agoFix typo in comment in yesterday's commit.
Bruno Haible [Fri, 7 Sep 2018 07:57:25 +0000 (09:57 +0200)]
Fix typo in comment in yesterday's commit.

6 years agostddef: Override max_align_t on NetBSD 8.0/x86.
Bruno Haible [Thu, 6 Sep 2018 20:44:01 +0000 (22:44 +0200)]
stddef: Override max_align_t on NetBSD 8.0/x86.

* m4/stddef_h.m4 (gl_STDDEF_H): When testing for max_align_t, test also
the value of __alignof__ (max_align_t).
* doc/posix-headers/stddef.texi: Mention the issue.

6 years agofcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku.
Bruno Haible [Thu, 6 Sep 2018 16:36:02 +0000 (18:36 +0200)]
fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku.

* lib/fcntl.c (rpl_fcntl): For F_DUPFD_CLOEXEC, don't even try the
system fcntl.
* doc/posix-functions/fcntl.texi: Document the issue.

6 years agocount-trailing-zeros tests: Rely on limits-h module.
Bruno Haible [Thu, 6 Sep 2018 12:50:04 +0000 (14:50 +0200)]
count-trailing-zeros tests: Rely on limits-h module.

* tests/test-count-trailing-zeros.c (ULLONG_MAX): Remove fallback
definition.
* modules/count-trailing-zeros-tests (Depends-on): Add 'limits-h'.

6 years agocount-leading-zeros tests: Rely on limits-h module.
Bruno Haible [Thu, 6 Sep 2018 12:49:14 +0000 (14:49 +0200)]
count-leading-zeros tests: Rely on limits-h module.

* tests/test-count-leading-zeros.c (ULLONG_MAX): Remove fallback
definition.
* modules/count-leading-zeros-tests (Depends-on): Add 'limits-h'.

6 years agocount-one-bits tests: Rely on limits-h module.
Bruno Haible [Thu, 6 Sep 2018 12:48:00 +0000 (14:48 +0200)]
count-one-bits tests: Rely on limits-h module.

* tests/test-count-one-bits.c (ULLONG_MAX): Remove fallback definition.
* modules/count-one-bits-tests (Depends-on): Add 'limits-h'.

6 years agoxstrtoll: Rely on limits-h module.
Bruno Haible [Thu, 6 Sep 2018 12:46:06 +0000 (14:46 +0200)]
xstrtoll: Rely on limits-h module.

* lib/xstrtol.c: Don't include intprops.h.
(ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions.
* modules/xstrtol (Depends-on): Remove 'intprops'.
* modules/xstrtoll (Depends-on): Add 'limits-h'.

6 years agostrtoll, strtoull: Rely on limits-h module.
Bruno Haible [Thu, 6 Sep 2018 12:41:00 +0000 (14:41 +0200)]
strtoll, strtoull: Rely on limits-h module.

* lib/strtol.c (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove macros.
(ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions.
* modules/strtoll (Depends-on): Add limits-h.
* modules/strtoull (Depends-on): Likewise.

6 years agointprops tests: Fix compilation error with pre-C99 compiler.
Bruno Haible [Thu, 6 Sep 2018 12:35:29 +0000 (14:35 +0200)]
intprops tests: Fix compilation error with pre-C99 compiler.

* tests/test-intprops.c (verify_stmt): New macro.
(VERIFY, main): Use it.

6 years agolimits-h: Provide numerical limits macros.
Bruno Haible [Thu, 6 Sep 2018 12:28:38 +0000 (14:28 +0200)]
limits-h: Provide numerical limits macros.

* lib/limits.in.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define also for
IRIX and for GCC.
(WORD_BIT, LONG_BIT): Define.
* m4/limits-h.m4 (gl_LIMITS_H): Set LIMITS_H to non-empty also when
<limits.h> does not define LLONG_MAX or WORD_BIT.
* tests/test-limits-h.c (TYPE_SIGNED, TYPE_WIDTH, TYPE_MINIMUM,
TYPE_MAXIMUM): New macros, from intprops.h.
Add tests for CHAR_BIT, WORD_BIT, LONG_BIT, <type>_MIN, and <type>_MAX.
* doc/posix-headers/limits.texi: Document what the 'limits-h' module
provides.

6 years agofcntl: Don't access nonexistent optional argument.
Bruno Haible [Thu, 6 Sep 2018 09:23:53 +0000 (11:23 +0200)]
fcntl: Don't access nonexistent optional argument.

Reported by Frank Busse <f.busse@imperial.ac.uk> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00018.html>.

* lib/fcntl.c (rpl_fcntl): For actions that don't take an argument,
don't consume an argument. For actions that take an 'int' argument,
consume an 'int' argument.

6 years agodoc: mention environ pitfall
Eric Blake [Thu, 31 May 2018 13:52:40 +0000 (08:52 -0500)]
doc: mention environ pitfall

Based on a bug report to the Cygwin list:
https://cygwin.com/ml/cygwin/2018-05/msg00321.html

* doc/posix-functions/environ.texi (environ): Assigning NULL to
environ is a glibc extension.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agognulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible [Mon, 3 Sep 2018 19:19:16 +0000 (21:19 +0200)]
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.

Reported by Antoine Luong <antoine.luong@c-s.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00008.html>.

* gnulib-tool (func_import): For the tests, set a dotfirst flag.
(func_emit_lib_Makefile_am): Consider the dotfirst flag.
(func_emit_tests_Makefile_am): Don't consider the dotfirst flag.

6 years agomktime: fix unlikely race+overflow bug
Paul Eggert [Sun, 2 Sep 2018 09:53:31 +0000 (02:53 -0700)]
mktime: fix unlikely race+overflow bug

Problem reported by Alexandre Oliva in:
https://sourceware.org/bugzilla/show_bug.cgi?id=16346
* lib/mktime.c (__mktime_internal): Access *OFFSET only once,
to avoid an unlikely race if the compiler delays a load and
if this cascades into a signed integer overflow.

6 years agomktime, timegm: simplify glibc time64_t
Paul Eggert [Sat, 1 Sep 2018 01:02:48 +0000 (18:02 -0700)]
mktime, timegm: simplify glibc time64_t

* lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]:
Now long int, not time_t, since long int is the longstanding type
for this in glibc and there is no need to change it even if time_t
becomes 64 bits - even int would do, though this would be a change
to the glibc generated code.  When this change is merged into
glibc, it should simplify the time_t vs time64_t situation.

6 years agomktime, timegm: simplify merge to glibc
Paul Eggert [Sat, 1 Sep 2018 01:02:48 +0000 (18:02 -0700)]
mktime, timegm: simplify merge to glibc

Move code around to make a merge to glibc easier to audit.
This should not change behavior.
* lib/mktime.c: Include more standard files unconditionally.
(NEED_MKTIME_INTERNAL, NEED_MKTIME_WINDOWS)
(NEED_MKTIME_WORKING): Give default values to pacify -Wundef,
which glibc uses.  Default NEED_MKTIME_WORKING to DEBUG_MKTIME, to
simplify later conditionals; default the others to zero.  In uses
of these conditionals, explicitly spell out how _LIBC affects
things, so it’s easier to review from a glibc viewpoint.
(my_tzset, __tzset) [!_LIBC]: New function and macro, to better
compartmentalize tzset issues.  Move system-dependent tzsettish
code here from mktime.
(mktime): Move tzsettish code to my_tzset, and move
localtime_offset to within mktime so that it doesn’t
need a separate ifdef.
* lib/mktime-internal.h (__gmtime_r, __localtime_r, __mktime_internal):
Move these macros here from lib/mktime.c and lib/gmtime.c.

6 years agoautoupdate
Karl Berry [Thu, 30 Aug 2018 13:27:53 +0000 (06:27 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Tue, 28 Aug 2018 15:20:16 +0000 (08:20 -0700)]
autoupdate

6 years agointprops: avoid evaluation of some expressions
Paul Eggert [Tue, 28 Aug 2018 01:31:44 +0000 (18:31 -0700)]
intprops: avoid evaluation of some expressions

This makes EXPR_SIGNED (e) easier to use, as it no longer
evaluates the expression E.  Formerly, E was required to be free
of side effects.
* lib/intprops.h (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT)
(EXPR_SIGNED, TYPE_WIDTH, _GL_INT_MINIMUM, _GL_INT_MAXIMUM)
(_GL_SIGNED_INT_MAXIMUM): Do not evaluate the expression arg.

6 years agoautoupdate
Paul Eggert [Sun, 26 Aug 2018 03:40:55 +0000 (20:40 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Sat, 25 Aug 2018 15:22:51 +0000 (08:22 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Fri, 24 Aug 2018 15:14:55 +0000 (08:14 -0700)]
autoupdate

6 years agogetcwd: Add cross-compilation guesses.
Bruno Haible [Thu, 23 Aug 2018 19:13:19 +0000 (21:13 +0200)]
getcwd: Add cross-compilation guesses.

Reported by Sergio Durigan Junior <sergiodj@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00130.html>.

Based on a patch by Paul Eggert.

* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Add cross-compilation
guesses for all GNU systems.

6 years ago; autoupdate
Paul Eggert [Thu, 23 Aug 2018 00:59:49 +0000 (17:59 -0700)]
; autoupdate

6 years agoautoupdate
Karl Berry [Mon, 20 Aug 2018 15:31:12 +0000 (08:31 -0700)]
autoupdate

6 years agoglob-h: Formalize side effects from other modules.
Bruno Haible [Sun, 19 Aug 2018 19:00:35 +0000 (21:00 +0200)]
glob-h: Formalize side effects from other modules.

* m4/glob_h.m4 (gl_REPLACE_GLOB_H): New macro.
* m4/glob.m4 (gl_GLOB): Invoke it.

6 years agofnmatch-h: Formalize side effects from other modules.
Bruno Haible [Sun, 19 Aug 2018 18:58:58 +0000 (20:58 +0200)]
fnmatch-h: Formalize side effects from other modules.

* m4/fnmatch_h.m4 (gl_REPLACE_FNMATCH_H): New macro.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Invoke it.

6 years agolimits-h: Formalize side effects from other modules.
Bruno Haible [Sun, 19 Aug 2018 18:57:24 +0000 (20:57 +0200)]
limits-h: Formalize side effects from other modules.

* m4/limits-h.m4 (gl_REPLACE_LIMITS_H): New macro.
* m4/stdint.m4 (gl_STDINT_H): Invoke it.

6 years agogetpass: Move declaration to <unistd.h>.
Bruno Haible [Sun, 19 Aug 2018 12:14:17 +0000 (14:14 +0200)]
getpass: Move declaration to <unistd.h>.

* lib/unistd.in.h (getpass): New declaration.
* lib/getpass.h: Replace with a stub that just includes <unistd.h>.
* m4/getpass.m4 (gl_FUNC_GETPASS): Declare through AC_DEFUN_ONCE.
Require gl_UNISTD_H_DEFAULTS. Don't test whether getpass is declared.
(gl_FUNC_GETPASS_GNU): Require gl_UNISTD_H_DEFAULTS and gl_FUNC_GETPASS.
On glibc systems, don't set REPLACE_GETPASS to 1.
* modules/getpass (Depends-on): Add 'unistd'.
(configure.ac): Test also REPLACE_GETPASS. Define a module indicator.
(Include): Specify <unistd.h> instead of "getpass.h".
* modules/getpass-gnu (Depends-on): Merely depend on 'getpass'.
(configure.ac): Sync with the configure.ac section of modules/getpass.
(Include): Specify <unistd.h> instead of "getpass.h".
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether getpass is declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETPASS, HAVE_GETPASS,
REPLACE_GETPASS.
* modules/unistd (Makefile.am): Substitute GNULIB_GETPASS, HAVE_GETPASS,
REPLACE_GETPASS.
* tests/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.

6 years agoglob: Fix over-optimization due to attribute __nonnull__.
Bruno Haible [Sun, 19 Aug 2018 10:03:27 +0000 (12:03 +0200)]
glob: Fix over-optimization due to attribute __nonnull__.

* lib/glob.c (_GL_ARG_NONNULL): Define to empty.

6 years agoglob: Fix another compilation error when glob.h is not replaced.
Bruno Haible [Sun, 19 Aug 2018 09:47:06 +0000 (11:47 +0200)]
glob: Fix another compilation error when glob.h is not replaced.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00112.html>.

* m4/glob.m4 (gl_GLOB): Set GLOB_H to non-empty when needed.
* m4/glob_h.m4 (gl_GLOB_H): Define through AC_DEFUN_ONCE.

6 years agofnmatch: Avoid conflicting macro definitions of 'fnmatch'.
Bruno Haible [Sun, 19 Aug 2018 01:00:13 +0000 (03:00 +0200)]
fnmatch: Avoid conflicting macro definitions of 'fnmatch'.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00108.html>.

* m4/fnmatch.m4 (gl_PREREQ_FNMATCH): Don't define 'fnmatch' as a macro
in config.h.

6 years agoAvoid -Wcast-function-type warnings from casts after GetProcAddress.
Bruno Haible [Sat, 18 Aug 2018 21:26:06 +0000 (23:26 +0200)]
Avoid -Wcast-function-type warnings from casts after GetProcAddress.

Reported by Andy Moreton <andrewjmoreton@gmail.com> in
<https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>.
Solution proposed by Eli Zaretskii.

* lib/getaddrinfo.c (GetProcAddress): Cast result to 'void *' first.
* lib/gettimeofday.c (GetProcAddress): Likewise.
* lib/link.c (GetProcAddress): Likewise.
* lib/physmem.c (GetProcAddress): Likewise.
* lib/poll.c (GetProcAddress): Likewise.
* lib/select.c (GetProcAddress): Likewise.
* lib/stat-w32.c (GetProcAddress): Likewise.

6 years agoglob: Fix another compilation error when glob.h is not replaced.
Bruno Haible [Sat, 18 Aug 2018 21:32:14 +0000 (23:32 +0200)]
glob: Fix another compilation error when glob.h is not replaced.

Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> again.

* lib/globfree.c: Include <libc-config.h>.

6 years agoglob: Fix compilation error when glob.h is not replaced.
Bruno Haible [Sat, 18 Aug 2018 20:44:28 +0000 (22:44 +0200)]
glob: Fix compilation error when glob.h is not replaced.

Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00096.html>.

* lib/glob_pattern_p.c: Include <libc-config.h>.
* modules/glob (Depends-on): Add libc-config.

6 years agoscratch_buffer: Add tests.
Bruno Haible [Sat, 18 Aug 2018 19:37:03 +0000 (21:37 +0200)]
scratch_buffer: Add tests.

* tests/test-scratch-buffer.c: New file.
* modules/scratch_buffer-tests: New file.

6 years agoscratch_buffer: Fix include file.
Bruno Haible [Sat, 18 Aug 2018 19:35:11 +0000 (21:35 +0200)]
scratch_buffer: Fix include file.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00082.html>.

* lib/scratch_buffer.h: Include <libc-config.h> first. Add
double-inclusion guard.

6 years agoglob-h: Revert Paul Eggert's revert.
Bruno Haible [Sat, 18 Aug 2018 19:31:30 +0000 (21:31 +0200)]
glob-h: Revert Paul Eggert's revert.

* m4/glob_h.m4: Revert to previous state.
* modules/glob-h: Likewise.

6 years agoglob-h: always build glob.h
Paul Eggert [Sat, 18 Aug 2018 07:54:35 +0000 (00:54 -0700)]
glob-h: always build glob.h

This works around a problem reported by Reuben Thomas in:
http://lists.gnu.org/r/bug-gnulib/2018-08/msg00079.html
This workaround always builds glob.h, even on platforms that
do not need it; perhaps this could be improved someday.
* m4/glob_h.m4 (gl_GLOB_H): Do not set or use GLOB_H, since glob.h
is always created now.
* modules/glob-h (BUILT_SOURCES, glob.h): Always build glob.h.

6 years agoautoupdate
Karl Berry [Tue, 14 Aug 2018 15:18:56 +0000 (08:18 -0700)]
autoupdate

6 years agomonetary: Simplify m4 code.
Bruno Haible [Tue, 14 Aug 2018 00:34:28 +0000 (02:34 +0200)]
monetary: Simplify m4 code.

* m4/monetary_h.m4 (gl_MONETARY_H): Define through AC_DEFUN_ONCE.
(gl_MONETARY_H_BODY): Inline into gl_MONETARY_H. Remove macro.

6 years agofnmatch-gnu: Revert part of last commit (unneeded).
Bruno Haible [Tue, 14 Aug 2018 00:29:23 +0000 (02:29 +0200)]
fnmatch-gnu: Revert part of last commit (unneeded).

6 years agofnmatch, fnmatch-gnu: Fix compilation error on Mac OS X.
Bruno Haible [Tue, 14 Aug 2018 00:00:05 +0000 (02:00 +0200)]
fnmatch, fnmatch-gnu: Fix compilation error on Mac OS X.

Reported by Jeroen Meijer <jjgmeijer@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00046.html>
and by Paul J. Lucas <paul@lucasmail.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00069.html>.

* m4/fnmatch_h.m4 (gl_FNMATCH_H): Define through AC_DEFUN_ONCE.
(gl_FNMATCH_H_GNU): New macro.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_GNU): Require gl_FNMATCH_H_GNU.

6 years agoautoupdate
Karl Berry [Mon, 13 Aug 2018 13:56:45 +0000 (06:56 -0700)]
autoupdate

6 years agosetlocale: Trivial simplification.
Bruno Haible [Sat, 11 Aug 2018 18:23:37 +0000 (20:23 +0200)]
setlocale: Trivial simplification.

* lib/setlocale.c (setlocale_unixlike): Remove redundant #if.

6 years agoFix ChangeLog typo.
Paul Eggert [Sun, 12 Aug 2018 01:58:55 +0000 (18:58 -0700)]
Fix ChangeLog typo.

6 years agoverify: port 'assume' to traditional tools
Paul Eggert [Sun, 12 Aug 2018 01:56:40 +0000 (18:56 -0700)]
verify: port 'assume' to traditional tools

* lib/verify.h (assume): Port better to Oracle Studio 12.6
and other tools that use /*NOTREACHED*/ comments.

6 years agofnmatch: Fix compilation error in C++ namespace mode on Mac OS X.
Bruno Haible [Sat, 11 Aug 2018 00:23:48 +0000 (02:23 +0200)]
fnmatch: Fix compilation error in C++ namespace mode on Mac OS X.

* modules/fnmatch-gnu (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/fnmatch.in.h (fnmatch): Skip _GL_CXXALIASWARN if module
'fnmatch-gnu' is in use.

6 years agoautoupdate
Paul Eggert [Fri, 10 Aug 2018 21:28:55 +0000 (14:28 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Wed, 8 Aug 2018 17:06:37 +0000 (10:06 -0700)]
autoupdate

6 years agoglob-h: Add tests.
Bruno Haible [Tue, 7 Aug 2018 08:54:41 +0000 (10:54 +0200)]
glob-h: Add tests.

* tests/test-glob-h.c: New file, partially based on tests/test-glob.c.
* tests/test-glob.c: Reorder #includes. Remove tests that are moved to
tests/test-glob-h.c.
* modules/glob-h-tests: New file.
* tests/test-glob-h-c++.cc: Renamed from tests/test-glob-c++.cc. Add
conditions.
* modules/glob-h-c++-tests: Renamed from modules/glob-c++-tests.
* modules/glob-tests (Depends-on): Remove glob-c++-tests.

6 years agoglob-h: New module.
Bruno Haible [Tue, 7 Aug 2018 08:43:06 +0000 (10:43 +0200)]
glob-h: New module.

* lib/glob.in.h: Use nearly the usual gnulib idioms for header file
replacements.
* lib/glob.c: Include <config.h>.
* m4/glob_h.m4: New file.
* m4/glob.m4 (gl_GLOB): Require gl_GLOB_H. Remove code that is moved to
glob_h.m4. Set HAVE_GLOB, REPLACE_GLOB, HAVE_GLOB_PATTERN_P,
REPLACE_GLOB_PATTERN_P as appropriate.
(gl_PREREQ_GLOB): Don't require AC_C_RESTRICT and
AC_USE_SYSTEM_EXTENSIONS, now done through module 'glob-h'.
* modules/glob-h: New file.
* modules/glob (Files): Remove lib/glob.in.h, lib/glob-libc.h.
(Dependencies): Add glob-h. Remove extensions, snippet/*, libc-config,
lstat, sys_stat. Change conditions.
(configure.ac): Test HAVE_GLOB, REPLACE_GLOB, HAVE_GLOB_PATTERN_P,
REPLACE_GLOB_PATTERN_P. Set module indicator.
(Makefile.am): Remove code that is moved to glob-h.
* doc/posix-headers/glob.texi: Mention the 'glob-h' module.
* modules/posixcheck (Depends-on): Add glob-h.

6 years agoForce generation of substitute .h file when C++ support is enabled.
Bruno Haible [Tue, 7 Aug 2018 00:00:37 +0000 (02:00 +0200)]
Force generation of substitute .h file when C++ support is enabled.

* m4/ansi-c++.m4 (gl_ANSI_CXX): New macro.
* modules/ansi-c++-opt (configure.ac): Just require gl_ANSI_CXX.
* m4/fnmatch_h.m4 (gl_FNMATCH_H): If C++ support is enabled, set
FNMATCH_H to non-empty.
* m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): If C++ support is enabled, set
ICONV_H to non-empty.
* m4/monetary_h.m4 (gl_MONETARY_H_BODY): If C++ support is enabled, set
MONETARY_H to non-empty.
* m4/utime_h.m4 (gl_UTIME_H): If C++ support is enabled, set UTIME_H to
non-empty.

6 years agofnmatch-h: Fix test compilation error on mingw (regression from today).
Bruno Haible [Mon, 6 Aug 2018 22:25:13 +0000 (00:25 +0200)]
fnmatch-h: Fix test compilation error on mingw (regression from today).

* lib/fnmatch.in.h: Fix conditions.

6 years agosys_resource: Relicense under LGPLv2+.
Bruno Haible [Mon, 6 Aug 2018 13:50:58 +0000 (15:50 +0200)]
sys_resource: Relicense under LGPLv2+.

John Malmberg's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00031.html>.

* modules/sys_resource (License): Change to LGPLv2+.

6 years agofnmatch-h: Add tests.
Bruno Haible [Mon, 6 Aug 2018 13:07:30 +0000 (15:07 +0200)]
fnmatch-h: Add tests.

* tests/test-fnmatch-h.c: New file.
* modules/fnmatch-h-tests: New file.
* tests/test-fnmatch-h-c++.cc: New file.
* modules/fnmatch-h-c++-tests: New file.

6 years agofnmatch-h: New module.
Bruno Haible [Mon, 6 Aug 2018 13:00:38 +0000 (15:00 +0200)]
fnmatch-h: New module.

* lib/fnmatch.in.h: Use the usual gnulib idioms for header file
replacements.
(FNM_*): Don't redefine if fnmatch exists and we are not overriding it.
(fnmatch): Use the usual gnulib idiom for function declarations. Enable
'posixcheck' warning.
* m4/fnmatch_h.m4: New file.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Require gl_FNMATCH_H. Remove
code that is moved to fnmatch_h.m4. When fnmatch does not exist, don't
bother testing whether it is working. Set HAVE_FNMATCH, REPLACE_FNMATCH
as appropriate.
* modules/fnmatch-h: New file.
* modules/fnmatch (Files): Remove lib/fnmatch.in.h.
(Dependencies): Add fnmatch-h. Remove extensions, snippet/*. Change
conditions.
(configure.ac): Test HAVE_FNMATCH and REPLACE_FNMATCH. Set module
indicator.
(Makefile.am): Remove code that is moved to fnmatch-h.
* modules/fnmatch-gnu (configure.ac): Test HAVE_FNMATCH and
REPLACE_FNMATCH.
* doc/posix-headers/fnmatch.texi: Mention the 'fnmatch-h' module.
* modules/posixcheck (Depends-on): Add fnmatch-h.

6 years agoEnable more C++ tests.
Bruno Haible [Mon, 6 Aug 2018 12:29:57 +0000 (14:29 +0200)]
Enable more C++ tests.

* modules/inttypes-tests (Depends-on): Add inttypes-c++-tests.
* modules/monetary-tests (Depends-on): Add monetary-c++-tests.
* modules/strings-tests (Depends-on): Add strings-c++-tests.
* modules/sys_resource-tests (Depends-on): Add sys_resource-c++-tests.
* modules/utime-h-tests (Depends-on): Add utime-h-c++-tests.

6 years agogetopt-posix, utime-h: Ensure the .h file gets regenerated when needed.
Bruno Haible [Mon, 6 Aug 2018 10:39:04 +0000 (12:39 +0200)]
getopt-posix, utime-h: Ensure the .h file gets regenerated when needed.

* modules/getopt-posix (Makefile.am): Add Makefile dependency for
getopt.h.
* modules/utime-h (Makefile.am): Add Makefile dependency for utime.h.

6 years agoutime-h: Generate header file when module 'posixcheck' is in use.
Bruno Haible [Sun, 5 Aug 2018 22:18:17 +0000 (00:18 +0200)]
utime-h: Generate header file when module 'posixcheck' is in use.

* m4/utime_h.m4 (gl_UTIME_H): If module 'posixcheck' is in use, set
UTIME_H to non-empty.

6 years agomonetary: Generate header file when module 'posixcheck' is in use.
Bruno Haible [Sun, 5 Aug 2018 22:16:43 +0000 (00:16 +0200)]
monetary: Generate header file when module 'posixcheck' is in use.

* m4/monetary_h.m4 (gl_MONETARY_H_BODY): If module 'posixcheck' is in
use, set MONETARY_H to non-empty.

6 years agoiconv-h: Generate header file when module 'posixcheck' is in use.
Bruno Haible [Sun, 5 Aug 2018 22:15:14 +0000 (00:15 +0200)]
iconv-h: Generate header file when module 'posixcheck' is in use.

* m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): If module 'posixcheck' is in use,
set ICONV_H to non-empty.

6 years agoOptimize the "checking whether ... is declared without a macro" checks.
Bruno Haible [Sun, 5 Aug 2018 21:25:56 +0000 (23:25 +0200)]
Optimize the "checking whether ... is declared without a macro" checks.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00339.html>.

* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Expand to nothing if the
Gnulib module 'posixcheck' is not in use.

6 years agoiconv-h: Enable 'posixcheck' warnings.
Bruno Haible [Sun, 5 Aug 2018 20:51:45 +0000 (22:51 +0200)]
iconv-h: Enable 'posixcheck' warnings.

* m4/iconv_h.m4 (gl_ICONV_H): Check for declarations of iconv and
iconv_open.
* lib/iconv.in.h (iconv_open, iconv): Use _GL_WARN_ON_USE.

6 years agoFix link error regarding 'rpl_environ' (regression from 2012-11-21).
Bruno Haible [Sun, 5 Aug 2018 12:06:08 +0000 (14:06 +0200)]
Fix link error regarding 'rpl_environ' (regression from 2012-11-21).

* m4/extern-inline.m4: Add more comments.
* lib/warn-on-use.h (_GL_WARN_ON_USE_ATTRIBUTE): New macro.
* lib/unistd.in.h (rpl_environ): Use it instead of _GL_WARN_ON_USE.
* lib/math.in.h (_GL_WARN_REAL_FLOATING_DECL): Likewise.

6 years agoNew module 'posixcheck'.
Bruno Haible [Sat, 4 Aug 2018 15:25:57 +0000 (17:25 +0200)]
New module 'posixcheck'.

* modules/posixcheck: New file.
* m4/posixcheck.m4: New file.
* doc/gnulib-tool.texi (Finding POSIX substitutes): New section.
(Which modules?): Reference it.

6 years agoautoupdate
Karl Berry [Fri, 3 Aug 2018 17:36:24 +0000 (10:36 -0700)]
autoupdate

6 years agodfa: fix memory leak
Assaf Gordon [Thu, 2 Aug 2018 04:14:21 +0000 (22:14 -0600)]
dfa: fix memory leak

* lib/dfa.c (dfafree): Add missing free() on dfa->superset.

6 years agoieee754-h: new module
Paul Eggert [Wed, 1 Aug 2018 23:08:26 +0000 (16:08 -0700)]
ieee754-h: new module

It looks like Emacs can use this for some NaN processing.
Emacs uses it only on double NaNs so it should be safe.
* MODULES.html.sh (func_all_modules): Add ieee754-h.
* config/srclist.txt: Mention ieee754.h in a comment.
* doc/glibc-headers/ieee754.texi (ieee754.h):
Gnulib now has a substitute that should work
except for long double and for non-IEEE platforms.
* lib/ieee754.in.h, m4/ieee754-h.m4, modules/ieee754-h:
* modules/ieee754-h-tests, tests/test-ieee754-h.c: New files.

6 years agoautoupdate
Paul Eggert [Wed, 1 Aug 2018 20:26:38 +0000 (13:26 -0700)]
autoupdate

6 years agoiswcntrl: Mention minor problem on macOS.
Bruno Haible [Fri, 27 Jul 2018 09:29:17 +0000 (11:29 +0200)]
iswcntrl: Mention minor problem on macOS.

* doc/posix-functions/iswcntrl.texi: Mention oddity on macOS.

6 years agobootstrap, gnulib-tool: fix translations rsync
Colin Watson [Fri, 27 Jul 2018 09:33:36 +0000 (11:33 +0200)]
bootstrap, gnulib-tool: fix translations rsync

6 years agobootstrap, gnulib-tool: fix translations rsync
Colin Watson [Fri, 27 Jul 2018 00:53:37 +0000 (17:53 -0700)]
bootstrap, gnulib-tool: fix translations rsync

Previously, we created files such as $pobase/Makefile.in.in and then the
subsequent rsync would immediately delete them.

* build-aux/bootstrap (po_download_command_format): Avoid deleting
non-.po files in target directory when rsyncing translations.
* gnulib-tool (func_import): Likewise.
* pygnulib/GLImport.py (GLImport.execute): Likewise.

6 years agoautoupdate
Karl Berry [Wed, 25 Jul 2018 15:02:40 +0000 (08:02 -0700)]
autoupdate

6 years agobootstrap: reinstate definition fo gnulib_mk.
Jim Meyering [Wed, 25 Jul 2018 07:08:39 +0000 (00:08 -0700)]
bootstrap: reinstate definition fo gnulib_mk.

That variable is used at least by cppi.
* build-aux/bootstrap (gnulib_mk): Restore definition.
This reverts the deletion from v0.1-1844-gc66dba9ba.

6 years agodoc: For module names, use texinfo markup @code{} or @samp{}.
Bruno Haible [Tue, 24 Jul 2018 01:31:36 +0000 (03:31 +0200)]
doc: For module names, use texinfo markup @code{} or @samp{}.

* doc/alloca.texi: Mark gnulib module names with @code.
* doc/alloca-opt.texi: Likewise.
* doc/quote.texi: Likewise.
* doc/posix-functions/freopen.texi: Likewise.
* doc/posix-functions/open.texi: Likewise.
* doc/posix-functions/readlink.texi: Likewise.
* doc/posix-functions/readlinkat.texi: Likewise.
* doc/posix-functions/stdout.texi: Likewise.
* doc/posix-functions/stderr.texi: Likewise.
* doc/posix-functions/unlink.texi: Likewise.
* doc/posix-functions/unlinkat.texi: Likewise.
* doc/posix-functions/utime.texi: Likewise.
* doc/posix-functions/utimensat.texi: Likewise.
* doc/posix-functions/utimes.texi: Likewise.
* doc/posix-headers/stdint.texi: Likewise.
* doc/glibc-functions/futimesat.texi: Likewise.
* doc/glibc-functions/lutimes.texi: Likewise.
* doc/glibc-functions/memmem.texi: Likewise.

6 years agodoc: Avoid some overfull lines in the TeX output.
Werner LEMBERG [Tue, 24 Jul 2018 00:46:14 +0000 (02:46 +0200)]
doc: Avoid some overfull lines in the TeX output.

* doc/glibc-functions/futimesat.texi: Replace a long @code with a
@example.
* doc/pastposix-functions/pthread_attr_getstackaddr.texi: Insert a
newline before the long URL.
* doc/pastposix-functions/pthread_attr_setstackaddr.texi: Likewise.
* doc/relocatable-maint.texi: Use @smallexample instead of @example.
Add line breaks in code snippets.

6 years agoautoupdate
Karl Berry [Thu, 19 Jul 2018 15:11:38 +0000 (08:11 -0700)]
autoupdate