]> Savannah Git Hosting - gnulib.git/log
gnulib.git
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

6 years agohard-locale: simplify by removing hard-locale.m4
Paul Eggert [Tue, 17 Jul 2018 23:13:46 +0000 (16:13 -0700)]
hard-locale: simplify by removing hard-locale.m4

* m4/hard-locale.m4: Remove.
* modules/hard-locale (Files): Remove m4/hard-locale.m4.
(configure.ac): Do not call gl_HARD_LOCALE.

6 years agognulib-tool: limit line length for git send-email
Paul Eggert [Tue, 17 Jul 2018 22:20:39 +0000 (15:20 -0700)]
gnulib-tool: limit line length for git send-email

* gnulib-tool (func_import): Break actioncmd log line
into multiple lines.

6 years agoffs: Ensure declaration on mingw.
Bruno Haible [Mon, 16 Jul 2018 22:49:06 +0000 (00:49 +0200)]
ffs: Ensure declaration on mingw.

Reported by Daniel P. Berrangé <berrange@redhat.com>
in https://lists.gnu.org/archive/html/bug-gnulib/2018-07/msg00061.html.

* m4/ffs.m4 (gl_FUNC_FFS): Check whether ffs() not only exists but is
also declared.

6 years agoautoupdate
Karl Berry [Sat, 14 Jul 2018 15:41:34 +0000 (08:41 -0700)]
autoupdate

6 years agoautoupdate
Paul Eggert [Fri, 13 Jul 2018 05:46:08 +0000 (00:46 -0500)]
autoupdate

6 years agoregex-tests: add dependency
Paul Eggert [Fri, 13 Jul 2018 05:42:55 +0000 (00:42 -0500)]
regex-tests: add dependency

* modules/regex-tests (Depends-on): Add gettext-h.
This is needed given the recent changes to regex,
which no longer depends on gettext-h.

6 years agoautoupdate
Karl Berry [Thu, 12 Jul 2018 16:04:47 +0000 (09:04 -0700)]
autoupdate

6 years agorenameatu: fix ChangeLog typo
Paul Eggert [Tue, 10 Jul 2018 14:32:25 +0000 (07:32 -0700)]
renameatu: fix ChangeLog typo

6 years agomkancesdirs: Add extern "C" to header
Simon Marchi [Tue, 10 Jul 2018 02:03:46 +0000 (19:03 -0700)]
mkancesdirs: Add extern "C" to header

* lib/mkancesdirs.h: Add extern "C".

6 years ago; autoupdate
Paul Eggert [Sat, 7 Jul 2018 04:59:14 +0000 (21:59 -0700)]
; autoupdate

6 years agoregex: now in sync with glibc
Paul Eggert [Fri, 6 Jul 2018 22:55:42 +0000 (15:55 -0700)]
regex: now in sync with glibc

* config/srclist.txt: Gnulib and glibc regex code
are synchronized again.

6 years agorenameatu: rename from renameat2
Paul Eggert [Thu, 5 Jul 2018 16:22:09 +0000 (09:22 -0700)]
renameatu: rename from renameat2

It's looking like Glibc will add a renameat2 function
that is incompatible with Gnulib renameat2; see:
https://sourceware.org/ml/libc-alpha/2018-07/msg00064.html
To help avoid future confusion, rename renameat2 to something else.
Use the name 'renameatu', as the Gnulib function is close to the
Glibc function.  Perhaps someday there will also be a renameat2
Gnulib module, which mimicks the future glibc renameat2, but that
can wait as nobody seems to need such a module now.
* NEWS: Mention this.
* lib/renameatu.c: Rename from lib/renameat2.c.
* lib/renameatu.h: Rename from lib/renameat2.h.
* modules/renameat2: Rename from modules/renameatu.
* modules/renameat2-tests: Rename from modules/renameat2-tests.
All uses of "renameat2" in identifiers or file name
changed to "renameatu", except for two instances in
lib/renameatu.c that deal with the Linux kernel's
renameat2 syscall.

6 years agognulib-tool: minor tweaks for --gnu-make
Paul Eggert [Thu, 5 Jul 2018 03:42:07 +0000 (20:42 -0700)]
gnulib-tool: minor tweaks for --gnu-make

* gnulib-tool: Do not allow --gnu-make in test modes,
since they all require automake.
(func_emit_lib_Makefile_am): Don’t emit automake comment
if --gnu-make.

6 years agoregex: work around conditional-dependencies glitch
Paul Eggert [Thu, 5 Jul 2018 03:18:48 +0000 (20:18 -0700)]
regex: work around conditional-dependencies glitch

* modules/regex (Depends-on): Add langinfo.
Without this change, I had problems building an experimental
version of GNU Emacs.  The symptom of the bug was a message
‘./configure: line 12726: test: =: unary operator expected’.
This was due to a line in gl_FUNC_NL_LANGINFO that invokes
‘test $HAVE_LANGINFO_CODESET = 1’ even though HAVE_LANGINFO_CODESET
was unset.  Although gl_FUNC_NL_LANGINFO has
‘AC_REQUIRE([gl_LANGINFO_H])’ and gl_LANGINFO_H always sets
HAVE_LANGINFO_CODESET to 0 or 1, gnulib-tool with
--conditional-dependencies sometimes arranges for the
gl_FUNC_NL_LANGINFO code to be executed before the gl_LANGINFO_H
code.  Since the regex code includes <langinfo.h> it should be
depending on the langinfo module anyway, and this happens to work
around the bug, so install that as a workaround for now.  To
reproduce the original problem, run the following shell script on
the version of Gnulib just before this patch was installed.
rm -fr foo
mkdir foo
cat >foo/configure.ac <<'EOF'
AC_INIT(GNU Emacs, 27.0.50, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/)
gl_EARLY
gl_INIT
AC_OUTPUT
EOF
./gnulib-tool --import --conditional-dependencies --gnu-make --dir foo regex
./gnulib-tool --copy build-aux/install-sh foo/install-sh
./gnulib-tool --copy build-aux/config.sub foo/config.sub
./gnulib-tool --copy build-aux/config.guess foo/config.guess
cd foo
aclocal -I m4
autoconf
./configure --with-included-regex

6 years agoautoupdate
Karl Berry [Wed, 4 Jul 2018 17:31:36 +0000 (10:31 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Tue, 3 Jul 2018 15:02:14 +0000 (08:02 -0700)]
autoupdate

6 years agowchar: fix bug when checking for ‘inline’
Paul Eggert [Mon, 2 Jul 2018 01:57:01 +0000 (18:57 -0700)]
wchar: fix bug when checking for ‘inline’

I discovered this when looking into using the regex module
with Emacs.
* m4/wchar_h.m4 (gl_WCHAR_H_INLINE_OK): Fix bug introduced in
2016-08-17T23:09:38Z!skunk@iSKUNK.ORG; the code compiled
conftest1.c and conftest2.c but these files were not created.
As far as I can see, this check never worked and nobody reported
it until now, which is a bit worrisome.

6 years agogetloadavg: don't redefine WINDOWS32
Paul Smith [Sun, 1 Jul 2018 22:00:52 +0000 (18:00 -0400)]
getloadavg: don't redefine WINDOWS32

* lib/getloadavg.c: Only define WINDOWS32 if it's not already defined.

6 years agobootstrap: s/--option val/--option=val/
Jim Meyering [Sun, 1 Jul 2018 02:57:07 +0000 (19:57 -0700)]
bootstrap: s/--option val/--option=val/

* build-aux/bootstrap (gnulib_tool_options): Change the
spelling of "--option val" pairs to "--option=val", for
aesthetics, and also so that this file no longer triggers
a common help2man syntax-check warning when copied into
projects like grep, gzip, etc.

6 years agomanywarnings: omit -Wswitch-default
Paul Eggert [Sun, 1 Jul 2018 14:08:32 +0000 (07:08 -0700)]
manywarnings: omit -Wswitch-default

This should make things more consistent, as we already ignore
-Wswitch-enum.  Problem reported by Reuben Thomas; see:
https://lists.gnu.org/r/bug-gnulib/2018-05/msg00179.html
* build-aux/g++-warning.spec, build-aux/gcc-warning.spec:
Add -Wswitch-default.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Remove -Wswitch-default.

6 years agoregex: revert most trimming
Paul Eggert [Sun, 1 Jul 2018 13:37:38 +0000 (06:37 -0700)]
regex: revert most trimming

Problems reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2018-07/msg00001.html
* modules/regex (Depends-on): Add lock, memcmp, memmove,
and wctype back in.  lock because regex users shouldn’t
need to know that regex needs locking, and the rest because
gnulib-tool should ordinarily ignore them anyway.

6 years agoregex: trim module dependencies
Paul Eggert [Sun, 1 Jul 2018 01:47:11 +0000 (18:47 -0700)]
regex: trim module dependencies

* modules/regex (Depends-on): Remove gettext-h and lock,
since the regex code should work OK without these modules,
and Emacs uses it that way.  Also remove memcmp, memmove,
and wctype, as these modules are obsolete and should not be
needed any more.

6 years agoregex: glibc does not use intprops.h
Paul Eggert [Fri, 29 Jun 2018 22:34:57 +0000 (15:34 -0700)]
regex: glibc does not use intprops.h

Maybe we can talk glibc into using intprops.h someday, but
now doesn’t seem to be a good time.
* lib/regcomp.c (TYPE_SIGNED): Remove; regex_internal.h now defines.
* lib/regex_internal.h [_LIBC]: Do not include intprops.h.
(TYPE_SIGNED, INT_ADD_WRAPV): New macros.

6 years agognulib-tool.py: import mktemp
Tim Rühsen [Wed, 13 Jun 2018 10:15:37 +0000 (12:15 +0200)]
gnulib-tool.py: import mktemp

* gnulib-tool.py: Import mktemp from tempfile

Signed-off-by: Dmitry Selyutin <ghostmansd@gmail.com>
6 years agoregex: port to recently proposed glibc regex merge
Paul Eggert [Thu, 28 Jun 2018 19:23:31 +0000 (12:23 -0700)]
regex: port to recently proposed glibc regex merge

This patch is inspired by Adhemerval Zanella's recent proposal
https://www.sourceware.org/ml/libc-alpha/2018-06/msg00905.html
to merge glibc and Gnulib regex.  It aims to simplify the merge on
the glibc side, without keeping Gnulib portable.
* lib/regex.h: Fix a problem with glibc installed-header checking,
as follows:
(_Restrict_): Prefer __restrict if defined or if GCC 2.95 or later.
(_Restrict_arr_): Prefer __restrict_arr if defined,
otherwise prefer _Restrict_ if C99 or GCC 3.1 or later (but not C++).
* lib/regex_internal.c (re_string_realloc_buffers, build_wcs_buffer)
(build_wcs_upper_buffer, build_upper_buffer)
(re_string_translate_buffer, re_string_context_at):
Move decls here from lib/regex_internal.h, for glibc internal tests.
(build_wcs_upper_buffer): Use __wcrtomb, not wcrtomb, fixing
glibc BZ #18496.
* lib/regex_internal.h (lock_fini) [_LIBC]: Cast to 0 to pacify
-Wunused-value.
(bitset_set, bitset_clear, bitset_contain, bitset_empty)
(bitset_set_all, bitset_copy, bitset_not, bitset_merge)
(bitset_mask): Now static inline, and without any __attribute__
((unused)) decoration, for glibc internal tests.

6 years agobuild-aux/config.sub
Karl Berry [Tue, 26 Jun 2018 15:26:25 +0000 (08:26 -0700)]
build-aux/config.sub

6 years agothreadlib: Fix LIBMULTITHREAD on platforms where --as-needed is enabled.
Bruno Haible [Tue, 26 Jun 2018 00:18:40 +0000 (02:18 +0200)]
threadlib: Fix LIBMULTITHREAD on platforms where --as-needed is enabled.

Reported by Erik Auerswald <auerswal@unix-ag.uni-kl.de>
in <https://lists.gnu.org/archive/html/coreutils/2018-06/msg00063.html>.

* m4/threadlib.m4 (gl_THREADLIB_BODY): Check whether the linker supports
--as-needed/--no-as-needed and --push-state/--pop-state. When defining
USE_POSIX_THREADS_WEAK or USE_SOLARIS_THREADS_WEAK or
USE_PTH_THREADS_WEAK, define LIBMULTITHREAD in such a way that -lpthread
/ -lthread / -lpth does not get optimized away by a preceding
--as-needed option.

6 years agoContinue to use spaces for indentation, not tabs.
Bruno Haible [Mon, 25 Jun 2018 19:45:23 +0000 (21:45 +0200)]
Continue to use spaces for indentation, not tabs.

6 years agomanywarnings: Don't enable -Wjump-misses-init warnings by default.
Bruno Haible [Mon, 25 Jun 2018 19:04:11 +0000 (21:04 +0200)]
manywarnings: Don't enable -Wjump-misses-init warnings by default.

* build-aux/gcc-warning.spec: Add -Wjump-misses-init.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Remove
-Wjump-misses-init.

6 years agoacl-internal.h: remove _GL_ATTRIBUTE_CONST on void function
Jim Meyering [Mon, 25 Jun 2018 15:28:12 +0000 (08:28 -0700)]
acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function

* lib/acl-internal.h (free_permission_context): Remove that
attribute directive.  Otherwise, it would provoke this from GCC 9:
lib/acl-internal.h:300:3: error: 'const' attribute on function \
  returning 'void' [-Werror=attributes]

6 years agoparse-datetime: accommodate gcc-4.8.5
Jim Meyering [Mon, 25 Jun 2018 03:47:58 +0000 (20:47 -0700)]
parse-datetime: accommodate gcc-4.8.5

Bruno Haible reported the build failure in
https://lists.gnu.org/r/bug-gnulib/2018-06/msg00066.html
* lib/parse-datetime.y (parse_datetime2): Remove leading "static"
on declaration of new local.

6 years agoaf_alg: Fail in continuable manner on Linux/powerpc64le.
Bruno Haible [Mon, 25 Jun 2018 02:18:30 +0000 (04:18 +0200)]
af_alg: Fail in continuable manner on Linux/powerpc64le.

Reported by Assaf Gordon <assafgordon@gmail.com>
in <https://lists.gnu.org/archive/html/coreutils/2018-06/msg00034.html>.

* lib/af_alg.c (afalg_stream): On non-seekable streams, try a single-
byte send() as the first round.

6 years agoaf_alg: Fix state of stream after sendfile() succeeds.
Bruno Haible [Sun, 24 Jun 2018 22:41:03 +0000 (00:41 +0200)]
af_alg: Fix state of stream after sendfile() succeeds.

* lib/af_alg.c (afalg_stream): Invoke fflush and lseek, to ensure that
the stream is correctly positioned afterwards.
* modules/crypto/af_alg (Depends-on): Add fflush.
* tests/test-digest.h (test_digest_on_files): Verify that after the
operation the stream is positioned at end of file.

6 years agocanon-host: take GCC9's advice rather than ignoring warning
Jim Meyering [Sun, 24 Jun 2018 23:54:43 +0000 (16:54 -0700)]
canon-host: take GCC9's advice rather than ignoring warning

Pádraig Brady suggested not to ignore this GCC9 advice.
* lib/canon-host.c: Undo preceding change.
* lib/canon-host.h: Instead, declare with _GL_ATTRIBUTE_MALLOC.

6 years agoparse-datetime.y: avoid spurious GCC 9 warning
Jim Meyering [Sun, 24 Jun 2018 22:58:09 +0000 (15:58 -0700)]
parse-datetime.y: avoid spurious GCC 9 warning

* lib/parse-datetime.y (parse_datetime2): Save RELATIVE_TIME_0 into
a function local prior to the first "goto fail".  The prior use would
evoke this:
parse-datetime.y: In function 'parse_datetime2':
parse-datetime.y:1791:19: error: jump skips variable initialization \
  [-Werror=jump-misses-init]
parse-datetime.y:2385:2: note: label 'fail' defined here
parse-datetime.y:188:43: note: '({anonymous})' declared here
parse-datetime.y:1841:12: note: in expansion of macro 'RELATIVE_TIME_0'

6 years agocanon-host.c: avoid spurious GCC 9 warning
Jim Meyering [Sun, 24 Jun 2018 18:51:48 +0000 (11:51 -0700)]
canon-host.c: avoid spurious GCC 9 warning

* lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc.

6 years agomanywarnings: accommodate GCC 9.0-pre: remove -Wchkp and -Wabi
Jim Meyering [Sun, 24 Jun 2018 18:31:50 +0000 (11:31 -0700)]
manywarnings: accommodate GCC 9.0-pre: remove -Wchkp and -Wabi

* build-aux/gcc-warning.spec: Add them here, each with an explanation.
* m4/manywarnings.m4: Remove them.
Otherwise, building coreutils, I would see this:
cc1: error: deprecated command line option '-Wchkp' [-Werror]
cc1: error: -Wabi won't warn about anything [-Werror=abi]
cc1: note: -Wabi warns about differences from the most up-to-date ABI,\
  which is also used by default
cc1: note: use e.g. -Wabi=11 to warn about changes from GCC 7

6 years agoaf_alg tests: Add another test.
Bruno Haible [Sun, 24 Jun 2018 23:02:39 +0000 (01:02 +0200)]
af_alg tests: Add another test.

* tests/test-digest.h (test_digest_on_files): Also check a large file
with a skipped header.
* tests/test-md5.c: Include macros.h.
* tests/test-sha1.c: Likewise.
* tests/test-sha256.c: Likewise.
* tests/test-sha512.c: Likewise.
* modules/crypto/md5-tests (Files): Add tests/macros.h.
* modules/crypto/sha1-tests (Files): Likewise.
* modules/crypto/sha256-tests (Files): Likewise.
* modules/crypto/sha512-tests (Files): Likewise.

6 years agomaint: clarify comments about sticky EOF
Pádraig Brady [Sun, 24 Jun 2018 22:15:16 +0000 (15:15 -0700)]
maint: clarify comments about sticky EOF

* lib/af_alg.c: Be more direct that we can't
assume stickiness of EOF for portability reasons.
* lib/md5.c: Clarify that this isn't just a glibc issue.
* lib/sha1.c: Likewise.
* lib/sha256.c: Likewise.
* lib/sha512.c: Likewise.

6 years agoaf_alg: Comment and style improvements.
Bruno Haible [Sun, 24 Jun 2018 22:25:31 +0000 (00:25 +0200)]
af_alg: Comment and style improvements.

* lib/af_alg.c (alg_socket): Use 'size_t' as index into a string.
(afalg_buffer, afalg_stream): Improve comments.

6 years agoFix order of most recent ChangeLog entries.
Bruno Haible [Sun, 24 Jun 2018 21:38:32 +0000 (23:38 +0200)]
Fix order of most recent ChangeLog entries.

6 years agoaf_alg: disable kernel hash functions by default
Pádraig Brady [Sun, 24 Jun 2018 09:09:12 +0000 (02:09 -0700)]
af_alg: disable kernel hash functions by default

All the kernel routines were seen to be significantly slower
with these relatively recent components on an i3-2310M system:
  kernel-4.10.6-200.fc25.x86_64
  openssl-1.0.2m-1.fc25.x86_64
sha1 was nearly twice as slow in the kernel for example,
compared to the libcrypto routines.

Further considerations why this should not be the default, at:
https://lists.gnu.org/r/coreutils/2018-06/msg00034.html

* m4/af_alg.m4: Require --with-linux-crypto to enable.
* m4/gl-openssl.m4: Tweak accordingly.

6 years agoaf_alg: avoid hangs when reading from streams
Pádraig Brady [Sun, 24 Jun 2018 08:46:10 +0000 (01:46 -0700)]
af_alg: avoid hangs when reading from streams

* lib/af_alg.c (afalg_stream): Don't assume EOF is sticky,
and thus avoid doing a fread() when feof() is set.
* lib/md5.c: Ensure feof() is called before fread().
* lib/sha1.c: Likewise.
* lib/sha256.c: Likewise.
* lib/sha512.c: Likewise.

6 years agoaf_alg: fix error handling when hash not returned
Pádraig Brady [Sun, 24 Jun 2018 08:29:55 +0000 (01:29 -0700)]
af_alg: fix error handling when hash not returned

* lib/af_alg.c (afalg_stream): Handle the case where we've
successfully written data to the kernel in the read/write loop,
but the kernel doesn't respond with the hash.

6 years agolibc-config: merge from glibc
Paul Eggert [Sun, 24 Jun 2018 15:50:36 +0000 (08:50 -0700)]
libc-config: merge from glibc

* lib/cdefs.h (__inline, __restrict):
Copy from current glibc.  This fixes glibc bug 17721,
which Gnulib had already fixed in a different way.
(__nonnull): Lessen the distance from glibc by using the
glibc definition inside an ‘#ifndef __nonnull’.
(__attribute_nonstring__): New macro, copied from
current glibc.
* lib/libc-config.h (__attribute_nonstring__): New undef.
(__restrict): Remove; workaround no longer needed.
Keep the __inline workaround, though, as it uses HAVE___INLINE to
support more compilers than the glibc __inline can.

6 years agombrtowc, wcwidth: Fix MT-safety bug (regression from 2018-06-23).
Bruno Haible [Sun, 24 Jun 2018 14:19:31 +0000 (16:19 +0200)]
mbrtowc, wcwidth: Fix MT-safety bug (regression from 2018-06-23).

* lib/mbrtowc.c (enc_t): New enum type.
(locale_enc, locale_enc_cached): New functions.
(mbrtowc): Eliminate static variables. Use locale_enc_cached instead.
* lib/wcwidth.c (is_locale_utf8, is_locale_utf8_cached): New functions.
(wcwidth): Eliminate static variables. Use is_locale_utf8_cached
instead.
* m4/mbrtowc.m4 (gl_PREREQ_MBRTOWC): Require AC_C_INLINE.
* m4/wcwidth.m4 (gl_PREREQ_WCWIDTH): New macro.
* modules/wcwidth (configure.ac): Invoke it.

6 years agowchar-single: Fix test failure in wcwidth tests.
Bruno Haible [Sun, 24 Jun 2018 14:10:16 +0000 (16:10 +0200)]
wchar-single: Fix test failure in wcwidth tests.

* tests/test-wcwidth.c (main): If the wchar-single module is present,
skip the tests in the C locale.

6 years agocrypto: mention --without-linux-crypto in --with-openssl --help
Pádraig Brady [Sun, 24 Jun 2018 04:02:36 +0000 (21:02 -0700)]
crypto: mention --without-linux-crypto in --with-openssl --help

* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Mention that linux crypto
routines take precedence in --with-openssl help output.

6 years agowchar-single: a new module to enable optimizations in wchar replacements
Pádraig Brady [Mon, 21 May 2018 05:11:12 +0000 (22:11 -0700)]
wchar-single: a new module to enable optimizations in wchar replacements

* lib/mbrtowc.c (mbrtowc): Only check locale_charset() once if
GNULIB_WCHAR_SINGLE is enabled.
* lib/wcwidth.c (wcwidth): Likewise.

6 years agolibc-config: Fix conflict with FreeBSD include files.
Bruno Haible [Sat, 23 Jun 2018 12:43:56 +0000 (14:43 +0200)]
libc-config: Fix conflict with FreeBSD include files.

* lib/cdefs.h (__nonnull): Remove definition.
* lib/libc-config.h (__nonnull): Remove undefinition.

6 years agorandom_r: do not crash if state is unaligned
Paul Eggert [Thu, 21 Jun 2018 19:28:34 +0000 (12:28 -0700)]
random_r: do not crash if state is unaligned

Problem reported by Bruce Korb in:
https://lists.gnu.org/r/bug-gnulib/2018-06/msg00030.html
I reproduced the crash on 32-bit sparc with Oracle Studio 12.6
with 'cc -O2 -xmemalign=8s'.
* lib/random_r.c: Include string.h, for memcpy.
(get_int32, set_int32): New functions.
(__srandom_r, __initstate_r, __setstate_r, __random_r):
Use them to avoid assumption that state pointer is aligned.
(__random_r): Avoid integer overflow if INT_MAX == UINT32_MAX.
* tests/test-random_r.c (test_failed): New function.
(main): Use it, to test for alignment bugs.

6 years agorandom_r: omit unnecessary include
Paul Eggert [Thu, 21 Jun 2018 18:25:53 +0000 (11:25 -0700)]
random_r: omit unnecessary include

* lib/random_r.c: Do not include limits.h.

6 years agorandom, random_r: merge from glibc
Paul Eggert [Thu, 21 Jun 2018 18:25:02 +0000 (11:25 -0700)]
random, random_r: merge from glibc

* lib/random.c, lib/random_r.c:
Include libc-config.h if !_LIBC, not config.h unilaterally.
* lib/random.c:
Do not include stdint.h or time.h; not needed.
Include libc-lock.h if _LIBC, and define substitute macros otherwise.
(unsafe_state): Rename from generator.  All uses changed.
Use C99-style initializers.
(__random, __srandom, __initstate, __setstate): Rename from
non-underscored version, but define it to non-underscored version
on Gnulib.  Add a lock.
* lib/random_r.c (__srandom_r, __initstate_r, __setstate_r, __random_r):
Likewise.
Do not include <stdint.h>; not needed since stdlib.h defines int32_t.
(weak_alias, __set_errno) [!_LIBC]: Remove; now done by libc-config.
(__srandom_r): Use int32_t instead of long int where int32_t will do.
(__random_r): Use uint32 to fix glibc bug 17343.
* modules/random, modules/random_r (Depends-on): Add libc-config.
Depend on stdint only if $HAVE_RANDOM = 0.

6 years agoREADME-release: also run any check-very-expensive tests
Jim Meyering [Tue, 19 Jun 2018 22:47:53 +0000 (15:47 -0700)]
README-release: also run any check-very-expensive tests

* top/README-release: Adjust instructions so they run the
check-very-expensive tests when there is such a target.

6 years agotypo
Karl Berry [Tue, 19 Jun 2018 15:58:15 +0000 (08:58 -0700)]
typo

6 years agopthread_rwlock_rdlock: Add comments regarding glibc behaviour.
Bruno Haible [Mon, 18 Jun 2018 16:16:34 +0000 (18:16 +0200)]
pthread_rwlock_rdlock: Add comments regarding glibc behaviour.

* m4/pthread_rwlock_rdlock.m4: Add comment.
* doc/posix-functions/pthread_rwlock_rdlock.texi: Mention that rwlocks
are reader-preferring in glibc.
* doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likwise.
* doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.

6 years agocrypto: use byteswap
Paul Eggert [Sun, 17 Jun 2018 21:35:37 +0000 (14:35 -0700)]
crypto: use byteswap

* lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
* lib/sm3.c: Include <byteswap.h>.
(SWAP): Use its macros rather than reinventing the wheel.
* modules/crypto/md4, modules/crypto/md5-buffer:
* modules/crypto/sha1-buffer, modules/crypto/sha256-buffer:
* modules/crypto/sha512-buffer, modules/crypto/sm3:
(Depends-on): Add byteswap.

6 years agogendocs.sh: fix support for legacy --texi2html
Pádraig Brady [Sun, 17 Jun 2018 21:26:28 +0000 (14:26 -0700)]
gendocs.sh: fix support for legacy --texi2html

* build-aux/gendocs.sh: Restrict use of TOP_NODE_UP_URL
to the default makeinfo invocation.
Reported by Bruce Korb

6 years agogettext po infrastructure: Update from current gettext git.
Bruno Haible [Sun, 17 Jun 2018 21:12:54 +0000 (23:12 +0200)]
gettext po infrastructure: Update from current gettext git.

Reported by Akim Demaille <akim@lrde.epita.fr>.

* build-aux/po/Makefile.in.in: Update from current gettext git.
* build-aux/po/remove-potcdate.sin: Likewise.
* config/srclist.txt: Temporarily disable sync for these files.

6 years agogetloadavg: Return 0 on Windows without Cygwin.
Bruno Haible [Sun, 17 Jun 2018 20:29:54 +0000 (22:29 +0200)]
getloadavg: Return 0 on Windows without Cygwin.

* lib/getloadavg.c: Don't assume that the symbol WINDOWS32 is defined.

6 years agogetloadavg: Allow building on Windows without Cygwin
Paul Smith [Sun, 17 Jun 2018 18:22:18 +0000 (11:22 -0700)]
getloadavg: Allow building on Windows without Cygwin

* lib/getloadavg.c: Reinstate ifdef for HAVE_UNISTD_H.
* m4/getloadavg.m4: Check for unistd.h.

6 years agoPort crypto/af_alg to GCC 4.8.4
Paul Eggert [Mon, 4 Jun 2018 01:02:10 +0000 (18:02 -0700)]
Port crypto/af_alg to GCC 4.8.4

Problem reported by Peter Simons in:
https://lists.gnu.org/r/bug-gnulib/2018-06/msg00002.html
* modules/crypto/af_alg (Depends-on): Add c99 if USE_AF_ALG.

6 years agoautoupdate
Karl Berry [Sun, 3 Jun 2018 15:42:45 +0000 (08:42 -0700)]
autoupdate

6 years agobootstrap: document source fetching in --help
Colin Watson [Sun, 27 May 2018 20:13:41 +0000 (22:13 +0200)]
bootstrap: document source fetching in --help

There are many possibilities for how Gnulib sources are fetched, and
they're rather hard to figure out without reading the code.

* build-aux/bootstrap (usage): Document how Gnulib sources are fetched.

6 years agobootstrap: allow non-submodule control of gnulib
Colin Watson [Sun, 27 May 2018 20:07:58 +0000 (22:07 +0200)]
bootstrap: allow non-submodule control of gnulib

Some projects prefer to avoid git submodules for various reasons (they
have rather strange UI), but at present they're the only way to pin a
particular gnulib commit.  Add a couple of extra variables which can be
set in bootstrap.conf to control this separately.

* build-aux/bootstrap: Honour GNULIB_URL and GNULIB_REVISION in
bootstrap.conf when fetching gnulib using "git clone" or via
GNULIB_SRCDIR.

6 years agoautoupdate
Karl Berry [Thu, 24 May 2018 15:46:18 +0000 (08:46 -0700)]
autoupdate

6 years agoautoupdate
Karl Berry [Wed, 23 May 2018 17:15:24 +0000 (10:15 -0700)]
autoupdate

6 years agocrypto: omit stream ops Emacs doesn’t need
Paul Eggert [Mon, 21 May 2018 17:32:25 +0000 (10:32 -0700)]
crypto: omit stream ops Emacs doesn’t need

* lib/md5.c (md5_stream):
* lib/sha1.c (sha1_stream):
* lib/sha256.c (shaxxx_stream, sha256_stream, sha224_stream):
* lib/sha512.c (shaxxx_stream, sha512_stream, sha384_stream):
Compile stream functions only if GL_COMPILE_CRYPTO_STREAM is
defined.  Emacs needs this, as it does not use the stream
operations and doesn’t need all the af_alg stuff we’ve recently
added.  Perhaps a similar change is needed to the other crypto
modules, but this patch changes only those needed for Emacs.
* modules/crypto/md5-buffer, modules/crypto/sha1-buffer:
* modules/crypto/sha256-buffer, modules/crypto/sha512-buffer:
New modules, used by Emacs.
* modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
* modules/crypto/sha512: Rewrite to depend on the new modules.

6 years agofts: avoid a memory leak edge case
Pádraig Brady [Mon, 14 May 2018 01:42:37 +0000 (18:42 -0700)]
fts: avoid a memory leak edge case

* lib/fts.c (fts_open): Set an appropriate fts_level
so that an immediate fts_close() will free the allocation.
* tests/test-fts.c (fts_dealloc): Add a test case which
will trigger under valgrind or address sanitizer.
Fixes https://bugs.gnu.org/31439

6 years agowcwidth tests: Fix link error.
Bruno Haible [Mon, 21 May 2018 00:42:01 +0000 (02:42 +0200)]
wcwidth tests: Fix link error.

* modules/wcwidth-tests (Makefile.am): Link test-wcwidth against
$(LIBUNISTRING).

6 years agoautoupdate
Karl Berry [Sun, 20 May 2018 13:49:39 +0000 (06:49 -0700)]
autoupdate

6 years agoregex: Fix "error: possibly undefined macro: gl_GLIBC21".
Bruno Haible [Sun, 20 May 2018 12:02:19 +0000 (14:02 +0200)]
regex: Fix "error: possibly undefined macro: gl_GLIBC21".

* modules/regex (Files): Add m4/glibc21.m4.

6 years agolocalcharset: Optimize.
Bruno Haible [Sun, 20 May 2018 10:59:01 +0000 (12:59 +0200)]
localcharset: Optimize.

* lib/localcharset.c (alias_table): Comment out no-op mappings for
platforms where these don't matter. This reduces the table size,
which in turn reduces the lookup time.

6 years agolocalcharset: Map the locale encodings found in newer OSes.
Bruno Haible [Sat, 19 May 2018 23:37:22 +0000 (01:37 +0200)]
localcharset: Map the locale encodings found in newer OSes.

* lib/localcharset.c (alias_table): Add mapping for locale encodings
found in FreeBSD 11, NetBSD 7, Solaris 10, Openindiana, HP-UX 11.31,
IRIX 6.5, Minix 3.3.
* lib/localcharset.h: Update comments accordingly. Also for Cygwin 2.9.

6 years agolocalcharset: Move mapping tables into the code.
Bruno Haible [Sat, 19 May 2018 15:17:32 +0000 (17:17 +0200)]
localcharset: Move mapping tables into the code.

* lib/localcharset.h: Document the GNU canonical names for character
encodings here.
* lib/localcharset.c: Don't include <fcntl.h>, <unistd.h>,
relocatable.h, configmake.h.
(O_NOFOLLOW, ISSLASH, DIRECTORY_SEPARATOR, getc, volatile): Remove
macros.
(charset_aliases): Remove variable.
(get_charset_aliases): Remove function.
(struct table_entry): New type.
(alias_table, locale_table): New constants.
(locale_charset): Use the alias_table or locale_table to get the
canonicalized encoding name.
* lib/config.charset: Remove file.
* lib/ref-add.sin: Remove file.
* lib/ref-del.sin: Remove file.
* m4/localcharset.m4 (gl_LOCALCHARSET): Don't require gl_FCNTL_O_FLAGS,
AC_CANONICAL_HOST, gl_GLIBC21. Don't check for getc_unlocked.
* modules/localcharset (Notice): Remove.
(Files): Remove config.charset, ref-add.sin, ref-del.sin, fcntl-o.m4,
glibc21.m4.
(Depends-on): Remove configmake.
(configure.ac): Define LOCALCHARSET_TESTS_ENVIRONMENT to empty.
(Makefile.am): Simplify.
* build-aux/prefix-gnulib-mk: Remove special code for the removed files.

6 years agolocalcharset: Add a manual test.
Bruno Haible [Sat, 19 May 2018 15:07:34 +0000 (17:07 +0200)]
localcharset: Add a manual test.

* tests/test-localcharset.c: New file.
* modules/localcharset-tests: New file.

6 years agolocalcharset: Remove support for obsolete platforms.
Bruno Haible [Sat, 19 May 2018 23:19:30 +0000 (01:19 +0200)]
localcharset: Remove support for obsolete platforms.

* lib/config.charset: Remove support for Linux/libc5, glibc-2.0.x, and
Mac OS X 10.2. Comment out dubious entry for Solaris.

6 years agognupload: adjust comment
Jim Meyering [Sat, 19 May 2018 19:01:06 +0000 (12:01 -0700)]
gnupload: adjust comment

* build-aux/gnupload: Add FIXME-2020 comment, to make it slightly
more likely we'll remove the just-added code in a year or two.

6 years agoautoupdate
Karl Berry [Sat, 19 May 2018 14:08:12 +0000 (07:08 -0700)]
autoupdate

6 years agognupload: Fix "gpg-agent is not available in this session" error.
Bruno Haible [Sat, 19 May 2018 11:00:16 +0000 (13:00 +0200)]
gnupload: Fix "gpg-agent is not available in this session" error.

* build-aux/gnupload (GPG): Pick the right GNUPG executable to use.

7 years agocrypto/af_alg: fix --help
Paul Eggert [Wed, 16 May 2018 19:02:41 +0000 (12:02 -0700)]
crypto/af_alg: fix --help

* m4/af_alg.m4: Avoid spurious newline in --help output.

7 years agoautoupdate
Karl Berry [Mon, 14 May 2018 14:54:47 +0000 (07:54 -0700)]
autoupdate

7 years agonl_langinfo: Fix compilation error on Android.
Bruno Haible [Mon, 14 May 2018 01:02:29 +0000 (03:02 +0200)]
nl_langinfo: Fix compilation error on Android.

* lib/nl_langinfo.c (nl_langinfo): Define values for the items GROUPING,
INT_CURR_SYMBOL, etc. only if these items are defined.

7 years agotruncate: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 23:48:22 +0000 (01:48 +0200)]
truncate: Fix compilation error on Android.

* m4/truncate.m4 (gl_FUNC_TRUNCATE): Test also whether 'truncate' is
declared. Set HAVE_DECL_TRUNCATE, not HAVE_TRUNCATE.
* lib/unistd.in.h (truncate): Test HAVE_DECL_TRUNCATE, not
HAVE_TRUNCATE.
* modules/truncate: Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_TRUNCATE,
not HAVE_TRUNCATE.
* modules/unistd (Makefile.am): Substitute HAVE_DECL_TRUNCATE, not
HAVE_TRUNCATE.
* doc/posix-functions/truncate.texi: Mention the issue.

7 years agopthread: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 23:02:02 +0000 (01:02 +0200)]
pthread: Fix compilation error on Android.

* lib/pthread.in.h: Use _GL_ALREADY_INCLUDING_PTHREAD_H to shortcut
recursive inclusion of this file.

7 years agoposix_spawn: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 22:27:43 +0000 (00:27 +0200)]
posix_spawn: Fix compilation error on Android.

* lib/spawn.in.h (posix_spawnattr_t): Consider also the case
HAVE_POSIX_SPAWNATTR_T = 1 && HAVE_POSIX_SPAWN = 0.
(posix_spawn_file_actions_t): Consider also the case
HAVE_POSIX_SPAWN_FILE_ACTIONS_T = 1 && HAVE_POSIX_SPAWN = 0.

7 years agotsearch: Move from K&R C to ANSI C.
Bruno Haible [Sun, 13 May 2018 22:04:54 +0000 (00:04 +0200)]
tsearch: Move from K&R C to ANSI C.

* lib/tsearch.c (tfind): Convert definition to ANSI C.

7 years agotsearch: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 22:02:48 +0000 (00:02 +0200)]
tsearch: Fix compilation error on Android.

* lib/search.in.h (twalk): Declare when HAVE_TWALK, not HAVE_TSEARCH,
is 0.
(GNULIB_defined_tsearch, GNULIB_defined_twalk): New macros.
* lib/tsearch.c (tsearch, tfind, tdelete): Define only if
GNULIB_defined_tsearch is true.
(twalk): Define only if GNULIB_defined_twalk is true.
* modules/tsearch (configure.ac): Compile tsearch.c also if HAVE_TWALK
is 0.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Set HAVE_TWALK.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize HAVE_TWALK.
* modules/search (Makefile.am): Substitute HAVE_TWALK.

7 years agoimaxdiv: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 21:23:47 +0000 (23:23 +0200)]
imaxdiv: Fix compilation error on Android.

* m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Set HAVE_IMAXDIV_T to 0 if imaxdiv_t
is not defined.
* lib/inttypes.in.h (imaxdiv_t): Define if HAVE_IMAXDIV_T, not
HAVE_DECL_IMAXDIV, is 0.
* m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Initialize HAVE_IMAXDIV_T.
* modules/inttypes-incomplete (Makefile.am): Substitute HAVE_IMAXDIV_T.

7 years agoSupport selective inclusion mechanism of recent mingw.org header files.
Bruno Haible [Sun, 13 May 2018 20:20:13 +0000 (22:20 +0200)]
Support selective inclusion mechanism of recent mingw.org header files.

Reported by Eli Zaretskii <eliz@gnu.org>.

* lib/sys_types.in.h: On mingw, when __need_off_t, __need___off64_t,
__need_ssize_t, or __need_time_t is defined, just include the system's
<sys/types.h>.
* lib/locale.in.h: On mingw, when __need_locale_t is defined, just
include the system's <locale.h>.

7 years agoAvoid compilation error due to 'mmap' on Android.
Bruno Haible [Sun, 13 May 2018 19:33:48 +0000 (21:33 +0200)]
Avoid compilation error due to 'mmap' on Android.

* lib/vma-iter.c (_FILE_OFFSET_BITS): Undefine on Android.
* lib/get-rusage-as.c (_FILE_OFFSET_BITS): Likewise.
* tests/zerosize-ptr.h (_FILE_OFFSET_BITS, __USE_FILE_OFFSET64):
Undefine on Android.

7 years agoAdd cross-compilation guesses for Linux systems without glibc.
Bruno Haible [Sun, 13 May 2018 18:25:13 +0000 (20:25 +0200)]
Add cross-compilation guesses for Linux systems without glibc.

* m4/chown.m4 (AC_FUNC_CHOWN): Add cross-compilation guess for Linux.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
* m4/link.m4 (gl_FUNC_LINK): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
* m4/mkdir.m4 (gl_FUNC_MKDIR): Likewise.
* m4/mkfifo.m4 (gl_FUNC_MKFIFO): Likewise.
* m4/mknod.m4 (gl_FUNC_MKNOD): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/readlink.m4 (gl_FUNC_READLINK): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/select.m4 (gl_FUNC_SELECT): Likewise.
* m4/stat.m4 (gl_FUNC_STAT): Likewise.
* m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/utimens.m4 (gl_UTIMENS): Likewise.

7 years agogetpagesize: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 16:28:35 +0000 (18:28 +0200)]
getpagesize: Fix compilation error on Android.

* m4/getpagesize.m4 (gl_CHECK_FUNC_GETPAGESIZE): New macro.
(gl_FUNC_GETPAGESIZE): Invoke it instead of AC_CHECK_FUNC.
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Don't invoke
AC_CHECK_FUNC. Instead, invoke gl_CHECK_FUNC_GETPAGESIZE and define
HAVE_GETPAGESIZE accordingly.
* modules/getcwd (Files): Add m4/getpagesize.m4.

7 years agotcgetsid: Fix compilation error on Android.
Bruno Haible [Sun, 13 May 2018 14:45:11 +0000 (16:45 +0200)]
tcgetsid: Fix compilation error on Android.

* m4/tcgetsid.m4 (gl_FUNC_TCGETSID): Use AC_LINK_IFELSE instead of
AC_CHECK_FUNC.

7 years agogetpass: Fix configure test for Android.
Bruno Haible [Sun, 13 May 2018 14:25:20 +0000 (16:25 +0200)]
getpass: Fix configure test for Android.

* m4/getpass.m4 (gl_PREREQ_GETPASS): Use AC_LINK_IFELSE instead of
AC_CHECK_FUNC.