]> Savannah Git Hosting - gnulib.git/log
gnulib.git
8 years agoSimplify "configure: checking ..." messages.
Bruno Haible [Sun, 16 Oct 2016 14:09:29 +0000 (16:09 +0200)]
Simplify "configure: checking ..." messages.

* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Use AC_MSG_CHECKING instead of
AC_MSG_NOTICE.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.

8 years agoquotearg-tests: pacify gcc -Wall
Paul Eggert [Thu, 20 Oct 2016 22:35:02 +0000 (15:35 -0700)]
quotearg-tests: pacify gcc -Wall

Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00066.html
* tests/test-quotearg-simple.c (use_quote_double_quotes): Move here ...
* tests/test-quotearg.h: ... from here.

8 years agocanonicalize-lgpl: fix for missing SIZE_MAX on older systems
Pádraig Brady [Thu, 20 Oct 2016 18:28:07 +0000 (11:28 -0700)]
canonicalize-lgpl: fix for missing SIZE_MAX on older systems

* lib/canonicalize-lgpl.c [SIZE_MAX]: Define if needed.
Needed on Centos <= 4.

8 years agoprintf.m4: fix a bug in detecting printf %j support
Jim Meyering [Thu, 20 Oct 2016 16:32:54 +0000 (09:32 -0700)]
printf.m4: fix a bug in detecting printf %j support

* m4/printf.m4 (gl_PRINTF_SIZES_C99): Fail any system for which
uintmax_t is defined in neither stdint.h nor inttypes.h.
Before, this macro might have mistakenly set
gl_cv_func_printf_sizes_c99=yes on such a system.
Spotted by Zev Weiss.

8 years agosched: substitute HAVE_SYS_CDEFS_H too
Paul Eggert [Thu, 20 Oct 2016 06:46:10 +0000 (23:46 -0700)]
sched: substitute HAVE_SYS_CDEFS_H too

Problem reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00084.html
* m4/sched_h.m4 (gl_SCHED_H): Set and substitute HAVE_SYS_CDEFS_H.
* modules/sched (Depends-on): Substitute HAVE_SYS_CDEFS_H.

8 years agoquotearg: never write beyond the returned length
Pádraig Brady [Tue, 18 Oct 2016 20:00:07 +0000 (13:00 -0700)]
quotearg: never write beyond the returned length

* lib/quotearg.c (quotearg_buffer_restyled): Switch to a read-only
scan of the string when we initially encounter a single quote when
shell quoting, so that if we then switch to a more concise quoting method
we will not have written beyond that returned length.
This is significant for sh-quote, which has separate routines
to determine the length and do the actual quoting.
* tests/test-quotearg.h: Reinstate the buffer bounds checking
now that we never write more than the returned length.

8 years agogetprogname tests: Avoid failure in packages that use libtool.
Bruno Haible [Tue, 18 Oct 2016 22:33:01 +0000 (00:33 +0200)]
getprogname tests: Avoid failure in packages that use libtool.

* tests/test-getprogname.c (main): Strip "lt-" prefix.
Based on a patch by Jim Meyering.

8 years agogetprogname: Fix test failure on Cygwin. Comments.
Bruno Haible [Sun, 16 Oct 2016 11:53:18 +0000 (13:53 +0200)]
getprogname: Fix test failure on Cygwin. Comments.

* lib/getprogname.h: Add comments.
* lib/getprogname.c: Add comments. Fix #elif indentation.
* tests/test-getprogname.c (main): On Cygwin, expect a result without
".exe" suffix.

8 years agoMake sure the libunistring detection rejects older versions with a known bug.
Bruno Haible [Sun, 16 Oct 2016 18:07:37 +0000 (20:07 +0200)]
Make sure the libunistring detection rejects older versions with a known bug.

* modules/unistr/u8-strtok (configure.ac): Bump required version.
* modules/unistr/u16-strtok (configure.ac): Likewise.
* modules/unistr/u32-strtok (configure.ac): Likewise.

8 years agosh-quote, system-quote: revert regression of unit test.
Bruno Haible [Tue, 18 Oct 2016 12:10:01 +0000 (14:10 +0200)]
sh-quote, system-quote: revert regression of unit test.

* tests/test-sh-quote.c (check_one): Do detect buffer overruns.
* tests/test-system-quote-main.c (check_one): Likewise.

8 years agoquotearg: fix stale tests
Pádraig Brady [Sun, 16 Oct 2016 21:51:30 +0000 (22:51 +0100)]
quotearg: fix stale tests

* tests/test-quotearg.c [locale_results]: Add the missing str7
entries to the expected results.
tests/test-system-quote-main.c (check_one): Don't enforce that we
don't write beyond the returned length, since that's no longer the
case if we switch to a more concise quoting style.
* tests/test-sh-quote.c (check_one): Likewise.
(main): Adjust for the new more concise quoting style.
Reported by Bruno Haible.

8 years agonon-recursive-gnulib-prefix-hack: fix inconsequential typo
Jim Meyering [Sun, 16 Oct 2016 20:24:09 +0000 (13:24 -0700)]
non-recursive-gnulib-prefix-hack: fix inconsequential typo

* m4/non-recursive-gnulib-prefix-hack.m4: Change a hard-coded "lib"
to "$1".  This macro is always invoked with $1 == lib.
Spotted by Bruno Haible

8 years agoFix a test crash.
Bruno Haible [Sun, 16 Oct 2016 18:09:16 +0000 (20:09 +0200)]
Fix a test crash.

* tests/test-duplocale.c (main): Skip the test if the 'newlocale' call
fails.

8 years agotest-limits-h: suppress -Woverlength-strings
Pádraig Brady [Sat, 15 Oct 2016 22:29:16 +0000 (23:29 +0100)]
test-limits-h: suppress -Woverlength-strings

* tests/test-limits-h.c [__GNUC__]: Ignore -Woverlength-strings.

8 years agogettime, timespec, utimens: Relicense under LGPL.
Bruno Haible [Sat, 15 Oct 2016 13:09:13 +0000 (15:09 +0200)]
gettime, timespec, utimens: Relicense under LGPL.

* modules/gettime (License): Change to LGPL.
* modules/timespec (License): Likewise.
* modules/utimens (License): Likewise.

8 years agocanonicalize-lgpl: Support the case path_max > INT_MAX.
Bruno Haible [Fri, 14 Oct 2016 00:49:05 +0000 (02:49 +0200)]
canonicalize-lgpl: Support the case path_max > INT_MAX.

* lib/canonicalize-lgpl.c (__realpath): Declare n as ssize_t, not int.

8 years agogetprogname: IBM z/OS: avoid NULL-dereference
Jim Meyering [Thu, 13 Oct 2016 21:59:10 +0000 (14:59 -0700)]
getprogname: IBM z/OS: avoid NULL-dereference

* lib/getprogname.c (getprogname) [__MVS__]: Don't dereference NULL
upon strdup failure.

8 years agotest-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering [Wed, 12 Oct 2016 19:30:07 +0000 (12:30 -0700)]
test-stdint: use _GL_VERIFY rather than "verify" for some tests

* tests/test-stdint.c (verify_width): Implement with _GL_VERIFY
and an abbreviated diagnostic rather than verify with the full one,
because the full-length strings would evoke warnings from gcc with
-Woverlength-strings.

8 years agoAdd missing ChangeLog entry
Paul Eggert [Thu, 13 Oct 2016 18:31:23 +0000 (11:31 -0700)]
Add missing ChangeLog entry

8 years agostdint: port SIZE_MAX to glibc s390
Paul Eggert [Thu, 13 Oct 2016 18:16:40 +0000 (11:16 -0700)]
stdint: port SIZE_MAX to glibc s390

Problem reported by Eric Blake in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00031.html
* doc/posix-headers/stdint.texi (stdint.h): Document the fix.
* m4/stdint.m4 (gl_STDINT_H): Check that SIZE_MAX has the
correct type, if possible.

8 years agogetprogname: port to IBM z/OS
Daniel Richard G [Thu, 13 Oct 2016 08:42:42 +0000 (09:42 +0100)]
getprogname: port to IBM z/OS

* lib/getprogname.c (getprogname): Use w_getpsent() to get the name.

8 years agomaint: remove stray space after "." in AC_DEFINE comment.
Jim Meyering [Wed, 12 Oct 2016 04:41:57 +0000 (21:41 -0700)]
maint: remove stray space after "." in AC_DEFINE comment.

* m4/st_dm_mode.m4 (AC_STRUCT_ST_DM_MODE): Remove space-after-".".
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.

8 years agolong-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
Jim Meyering [Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)]
long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough

* lib/long-options.c (parse_long_options): Add a break statement
to avoid this new warning/failure:
$ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \
  --create-testdir --dir=/t/x --with-tests --test long-options
../../gllib/long-options.c: In function 'parse_long_options':
../../gllib/long-options.c:66:12: error: this statement may \
  fall through [-Werror=implicit-fallthrough]
           (*usage_func) (EXIT_SUCCESS);
           ~^~~~~~~~~~~~~~~~~~~~~~~~~~~

8 years agoutimecmp: avoid new GCC 7 warning from -Wbool-operation
Jim Meyering [Wed, 5 Oct 2016 16:13:55 +0000 (09:13 -0700)]
utimecmp: avoid new GCC 7 warning from -Wbool-operation

Testing this module would fail when using GCC 7 like this:
$ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \
  --dir=/tmp/x --with-tests --test utimecmp
../../gllib/utimecmp.c: In function ‘utimecmp’:
../../gllib/utimecmp.c:291:36: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
                 time_t s = src_s & ~ (res == 2 * BILLION);
                                    ^
../../gllib/utimecmp.c:370:16: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
       src_s &= ~ (res == 2 * BILLION);
                ^
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.
Instead, make it explicit that we intend to apply it to 0 or 1.

8 years agodfa: save memory for states
Norihiro Tanaka [Mon, 10 Oct 2016 14:08:29 +0000 (23:08 +0900)]
dfa: save memory for states

* src/dfa (dfaexec_main): Beginning of dfa execution, release caches of
states if dfa has a lot of caches.

8 years agowchar, wctype-h: fix for MinGW 3.22.2
Eli Zaretskii [Mon, 10 Oct 2016 15:05:36 +0000 (08:05 -0700)]
wchar, wctype-h: fix for MinGW 3.22.2

* lib/wchar.in.h [__MINGW32__]: Add one more condition for
special invocation, to fix issues with MinGW 3.22.2 wchar.h
when included from <string.h>.
* lib/wctype.in.h [__MINGW32__]: Add special invocation
convention for MinGW 3.22.2, to solve issues with their
wctype.h when included from <ctype.h>.

8 years agolong-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
Jim Meyering [Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)]
long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough

* lib/long-options.c (parse_long_options): Add a break statement
to avoid this new warning/failure:
$ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \
  --create-testdir --dir=/t/x --with-tests --test long-options
../../gllib/long-options.c: In function ‘parse_long_options’:
../../gllib/long-options.c:66:12: error: this statement may \
  fall through [-Werror=implicit-fallthrough]
           (*usage_func) (EXIT_SUCCESS);
           ~^~~~~~~~~~~~~~~~~~~~~~~~~~~

8 years agoutimecmp: avoid new GCC 7 warning from -Wbool-operation
Jim Meyering [Wed, 5 Oct 2016 16:13:55 +0000 (09:13 -0700)]
utimecmp: avoid new GCC 7 warning from -Wbool-operation

Testing this module would fail when using GCC 7 like this:
$ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \
  --dir=/tmp/x --with-tests --test utimecmp
../../gllib/utimecmp.c: In function ‘utimecmp’:
../../gllib/utimecmp.c:291:36: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
                 time_t s = src_s & ~ (res == 2 * BILLION);
                                    ^
../../gllib/utimecmp.c:370:16: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
       src_s &= ~ (res == 2 * BILLION);
                ^
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.
Instead, make it explicit that we intend to apply it to 0 or 1.

8 years agoautoupdate
Karl Berry [Mon, 3 Oct 2016 21:26:04 +0000 (14:26 -0700)]
autoupdate

8 years agoquotearg: minimize shell quoting using double quotes
Pádraig Brady [Mon, 26 Sep 2016 14:13:34 +0000 (15:13 +0100)]
quotearg: minimize shell quoting using double quotes

I.E. 'it'\''s awkward like this'; "it's better like this"

* lib/quotearg.c (quotearg_buffer_restyled): If an ASCII single
quote in encountered then use double quotes (c style quoting)
when possible, as it simplifies the quoting.
* tests/test-quotearg-simple.c: Add test cases.
* tests/test-quotearg.h (use_quotearg_buffer): Adjust to account
for the fact we now may write beyond the returned length.

8 years agovasnprintf.c: avoid spurious warning from GCC 7
Jim Meyering [Sun, 2 Oct 2016 19:09:13 +0000 (12:09 -0700)]
vasnprintf.c: avoid spurious warning from GCC 7

The presence of cpp directives renders this "FALLTHROUGH" comment
ineffective, so does not suppress the -Wimplicit-fallthrough warning
from GCC 7 built from git on 2016-10-02.
* lib/vasnprintf.c (VASNPRINTF): Move comment down past two cpp
directives, so that it takes effect once again.  This is clearly
not a proper change, and I will revert it once this bug is fixed:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817

8 years agogetprogname: correct the test for a __progname variable
Jim Meyering [Sun, 2 Oct 2016 02:53:52 +0000 (19:53 -0700)]
getprogname: correct the test for a __progname variable

* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Use AC_CACHE_CHECK
and AC_LINK_IFELSE to check for a global __progname.  If found,
define HAVE_VAR___PROGNAME.
* lib/getprogname.c (getprogname): Reflect the new name of the
preprocessor symbol: s/HAVE_DECL___PROGNAME/HAVE_VAR___PROGNAME/
Assaf Gordon reported that the erroneous prior check caused
link failure on AIX 7 in
https://lists.gnu.org/archive/html/grep-devel/2016-10/msg00001.html

8 years agou8-uctomb-aux.c: build: placate GCC 7's new -Wimplicit-fallthrough
Jim Meyering [Thu, 29 Sep 2016 04:36:55 +0000 (21:36 -0700)]
u8-uctomb-aux.c: build: placate GCC 7's new -Wimplicit-fallthrough

* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Mark each end of
fall-through case with a /* fallthrough */ comment.

8 years agodfa: build: avoid warning from GCC 7's new -Wimplicit-fallthrough
Jim Meyering [Thu, 29 Sep 2016 04:20:38 +0000 (21:20 -0700)]
dfa: build: avoid warning from GCC 7's new -Wimplicit-fallthrough

* lib/dfa.c (dfassbuild): Mark the end of this case with a
/* fallthrough */ comment.

8 years agogetprogname: avoid __progname vs program_invocation_short_name pitfall
Jim Meyering [Thu, 29 Sep 2016 03:57:24 +0000 (20:57 -0700)]
getprogname: avoid __progname vs program_invocation_short_name pitfall

I.e., don't let the OpenBSD 5.1 fix induce failure when using newer
glibc.  Would have caused failure with Fedora 25's glibc-2.24-3, but
not with Fedora 24's glibc-2.23.1-10.
* lib/getprogname.c (__progname): Move this declaration down...
(getprogname): ... into the #elif block where used, and make it
explicitly "extern".

8 years agogetprogname: port to OpenBSD 5.1
Jim Meyering [Wed, 28 Sep 2016 18:09:03 +0000 (11:09 -0700)]
getprogname: port to OpenBSD 5.1

* lib/getprogname.c (__progname) [HAVE_DECL___PROGNAME]: Declare.
(getprogname) [HAVE_DECL___PROGNAME]: Return __progname or "?".
* modules/getprogname (configure.ac): Move most of this code...
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): ... to this function,
increment serial number, and add a test for __progname.
https://bugs.gnu.org/24562
Reported by Nelson H. F. Beebe.

8 years agosched: port to GCC 6.2.1 on macOS Sierra
Paul Eggert [Sun, 25 Sep 2016 04:10:12 +0000 (21:10 -0700)]
sched: port to GCC 6.2.1 on macOS Sierra

Problem reported by Denis Davydov in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00056.html
* lib/sched.in.h [HAVE_SYS_CDEFS_H]:
Include <sys/cdefs.h> before <sched.h>.
* m4/nproc.m4 (gl_PREREQ_NPROC): Include errno.h before sched.h,
so that we needn’t worry about the sched.h include bug here.
* m4/sched_h.m4 (gl_SCHED_H): Check for sys/cdefs.h,
and include it before <sched.h> if it exists, when
checking for <sched.h>.

8 years agotests/init.sh: port Alpine fix to AIX 7.1
Paul Eggert [Sun, 25 Sep 2016 03:13:43 +0000 (20:13 -0700)]
tests/init.sh: port Alpine fix to AIX 7.1

* tests/init.sh (compare_): When attempting to use diff -U3,
prefer diff -u to -U3 to -c to plain diff.  Do not insist on

8 years agonl_langinfo: pacify GCC
Paul Eggert [Thu, 22 Sep 2016 21:42:15 +0000 (14:42 -0700)]
nl_langinfo: pacify GCC

* lib/nl_langinfo.c (ctype_codeset): Remove unused local.
(rpl_nl_langinfo): Cast string literals to char *, to pacify GCC.

8 years agostdint: also set GL_GENERATE_LIMITS_H
Paul Eggert [Thu, 22 Sep 2016 18:44:39 +0000 (11:44 -0700)]
stdint: also set GL_GENERATE_LIMITS_H

Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00052.html
* m4/stdint.m4 (gl_STDINT_H): Also redo the AM_CONDITIONAL.

8 years agolimits-h, stdint: Don't assume extensions, fix typo
Paul Eggert [Thu, 22 Sep 2016 17:47:57 +0000 (10:47 -0700)]
limits-h, stdint: Don't assume extensions, fix typo

* m4/limits-h.m4 (gl_LIMITS_H):
* m4/stdint.m4 (gl_STDINT_H):
Don't assume AC_USE_SYSTEM_EXTENSIONS.
* m4/stdint.m4 (gl_STDINT_H): Fix typo in setting of LIMITS_H,
reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00050.html

8 years agogetprogname: port to AIX
Jim Meyering [Thu, 22 Sep 2016 04:15:59 +0000 (21:15 -0700)]
getprogname: port to AIX

* lib/getprogname.c (getprogname) [_AIX]: Use getpid, getprocs64
and strdup to obtain a short program name string.  Using code from
Bruno Haible and an idea from Bastien ROUCARIÈS, in
https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00249.html
Assaf Gordon reported that this new file would fail to compile on
AIX-7.1 32bit.

8 years agoupdate from texinfo
Karl Berry [Mon, 19 Sep 2016 16:32:31 +0000 (09:32 -0700)]
update from texinfo

8 years agoupdate from texinfo
Karl Berry [Sun, 18 Sep 2016 16:12:57 +0000 (09:12 -0700)]
update from texinfo

8 years agoextensions: fix typo in comment
Paul Eggert [Thu, 15 Sep 2016 19:30:25 +0000 (12:30 -0700)]
extensions: fix typo in comment

* m4/extensions.m4: Sync from Autoconf master.

8 years agostdint: support new _WIDTH macros
Paul Eggert [Thu, 15 Sep 2016 18:34:52 +0000 (11:34 -0700)]
stdint: support new _WIDTH macros

* doc/posix-headers/stdint.texi: Document this.
* lib/stdint.in.h: Add support for INTMAX_WIDTH. etc.
* m4/stdint.m4 (gl_STDINT_H): Require gl_LIMITS_H.  Check for
support for INTMAX_WIDTH, etc. as well as for support for just C99.
* modules/stdint (Depends-on): Add limits-h.
(Makefile.am): Substitute HAVE_C99_STDINT_H.
* modules/stdint-tests (Depends-on): Add extensions, so that
INTMAX_MAX etc. are defined.
* tests/test-stdint.c: Verify the new macros.

8 years agolimits-h: new module
Paul Eggert [Thu, 15 Sep 2016 18:34:52 +0000 (11:34 -0700)]
limits-h: new module

This adds ISO/IEC TS 18661-1:2014 support to limits.h.
* MODULES.html.sh: Add limits-h,and move size_max to stdint section.
* doc/posix-headers/limits.texi: Document new module.
* lib/limits.in.h, m4/limits-h.m4, modules/limits-h:
* modules/limit-h-tests, tests/test-limits-h.c: New files.

8 years agostdio: don't redefine __USE_MINGW_ANSI_STDIO
Paul Eggert [Fri, 16 Sep 2016 07:37:14 +0000 (00:37 -0700)]
stdio: don't redefine __USE_MINGW_ANSI_STDIO

* m4/stdio_h.m4 (gl_STDIO_H): Don't define __USE_MINGW_ANSI_STDIO
if it is already defined.  Apparently GNU Emacs relies on this.  See:
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00416.html

8 years agosys_types: avoid glibc 2.25 warnings about major()
Eric Blake [Thu, 15 Sep 2016 00:36:14 +0000 (19:36 -0500)]
sys_types: avoid glibc 2.25 warnings about major()

glibc 2.25 is deprecating the namespace pollution of <sys/types.h>
injecting major(), minor(), and makedev() into the compilation
environment, with a warning that insists that users include
<sys/sysmacros.h> instead.  However, because the expansion of
AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until
after probing whether sys/types.h pollutes the namespace, it was
not defining MAJOR_IN_SYSMACROS, with the result that code
compiled with -Werror chokes on the deprecation warnings because
it was not including sysmacros.h.

Backport the autoconf fix (see autoconf commit e17a30e98), so that
gnulib projects avoid the warnings even when using older autoconf.

* m4/sys_types_h.m4 (AC_HEADER_MAJOR): Replace broken version in
older autoconf.
* doc/posix-headers/sys_types.texi (sys/types.h): Document fix.
* doc/glibc-functions/gnu_dev_major.texi (gnu_dev_major): Likewise.
* doc/glibc-functions/gnu_dev_makedev.texi (gnu_dev_makedev): Likewise.
* doc/glibc-functions/gnu_dev_minor.texi (gnu_dev_minor): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agomountlist: include sysmacros.h for glibc
Eric Blake [Thu, 15 Sep 2016 00:21:42 +0000 (19:21 -0500)]
mountlist: include sysmacros.h for glibc

On Fedora rawhide (glibc 2.25), './gnulib-tool --test mountlist'
reports:
../../gllib/mountlist.c: In function 'read_file_system_list':
../../gllib/mountlist.c:534:13: warning: '__makedev_from_sys_types' is deprecated:
  In the GNU C Library, `makedev' is defined by <sys/sysmacros.h>.
  For historical compatibility, it is currently defined by
  <sys/types.h> as well, but we plan to remove this soon.
  To use `makedev', include <sys/sysmacros.h> directly.
  If you did not intend to use a system-defined macro `makedev',
  you should #undef it after including <sys/types.h>.
  [-Wdeprecated-declarations]
             me->me_dev = makedev (devmaj, devmin);
             ^~
In file included from /usr/include/features.h:397:0,
                 from /usr/include/sys/types.h:25,
                 from ./sys/types.h:28,
                 from ../../gllib/mountlist.h:23,
                 from ../../gllib/mountlist.c:20:
/usr/include/sys/sysmacros.h:89:1: note: declared here
 __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_FST_IMPL_TEMPL)
 ^

Fix it by including the right headers.  We also need a fix to
autoconf's AC_HEADER_MAJOR, but that's a separate patch.

* m4/mountlist.m4 (gl_PREREQ_MOUTLIST_EXTRA): Include
AC_HEADER_MAJOR.
* lib/mountlist.c (includes): Use correct headers.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoextensions: port to more ISO C TSes
Paul Eggert [Thu, 15 Sep 2016 17:32:54 +0000 (10:32 -0700)]
extensions: port to more ISO C TSes

* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Sync from Autoconf
master, to add support for more recent ISO C TRs and TSes.

8 years agointprops: new macro TYPE_WIDTH
Paul Eggert [Wed, 14 Sep 2016 04:49:10 +0000 (21:49 -0700)]
intprops: new macro TYPE_WIDTH

* lib/intprops.h (TYPE_WIDTH): New macro.
(TYPE_MAXIMUM, _GL_SIGNED_INT_MAXIMUM, INT_STRLEN_BOUND):
* lib/ftoastr.h (_GL_FLOAT_DIG_BITS_BOUND):
* lib/parse-datetime.y (parse_datetime2):
Use it.

8 years agoextensions: port to recent ISO C TRs
Paul Eggert [Wed, 14 Sep 2016 01:34:20 +0000 (18:34 -0700)]
extensions: port to recent ISO C TRs

* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS):
Sync from Autoconf master, to add support for recent ISO C TRs.
* m4/stdio_h.m4 (gl_STDIO_H): Define __USE_MINGW_ANSI_STDIO here,
since AC_USE_SYSTEM_EXTENSIONS no longer does that as
the MinGW option is not an extension.

8 years agoupdate from texinfo
Karl Berry [Tue, 13 Sep 2016 15:53:06 +0000 (08:53 -0700)]
update from texinfo

8 years agoupdate from texinfo
Karl Berry [Mon, 12 Sep 2016 14:26:44 +0000 (07:26 -0700)]
update from texinfo

8 years agodfa: port to Solaris 9
Paul Eggert [Sun, 11 Sep 2016 23:13:11 +0000 (16:13 -0700)]
dfa: port to Solaris 9

Problems reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00031.html
* modules/dfa (Depends-on): Add isblank.
* modules/dfa-tests (dfa_match_aux_LDADD):
Rename from test_stat_LDADD, to fix typo.
* tests/dfa-match.sh: Don't require 'timeout'; use it if available.

8 years agoautoupdate
Karl Berry [Sun, 11 Sep 2016 12:38:19 +0000 (05:38 -0700)]
autoupdate

8 years agostrverscmp: avoid link failure on OS X
Jim Meyering [Sun, 11 Sep 2016 00:50:58 +0000 (17:50 -0700)]
strverscmp: avoid link failure on OS X

* lib/strverscmp.c [!weak_alias]: Define __strverscmp to strverscmp.
Reported by Assaf Gordon in https://bugs.gnu.org/24256#26

8 years agodfa: new module, importing grep's DFA matcher
Jim Meyering [Tue, 16 Aug 2016 22:00:43 +0000 (15:00 -0700)]
dfa: new module, importing grep's DFA matcher

Since grep's DFA matcher is now being used by two gnulib-enabled
projects, grep and sed, it makes sense to version-control its
sources and unit tests in one place: here.
* modules/dfa: New module.
* modules/dfa-tests: New file.
* lib/dfa.c: New file, from grep.
* lib/dfa.h: Likewise.
* lib/localeinfo.c: Likewise.
* lib/localeinfo.h: Likewise.
* tests/dfa-match-aux.c: Likewise.
* tests/dfa-invalid-char-class.sh: Likewise.
* tests/dfa-match.sh: Likewise, with minor changes.
* MODULES.html.sh (Misc): Add "dfa" to this list.

8 years agogetprogname-tests: don't depend on assert-h
Jim Meyering [Fri, 9 Sep 2016 22:46:53 +0000 (15:46 -0700)]
getprogname-tests: don't depend on assert-h

* modules/getprogname-tests (Depends-on): Remove assert-h.
It was not needed, and in fact would cause build failure for
coreutils on some systems.  Reported by Assaf Gordon in https:
//lists.gnu.org/archive/html/coreutils/2016-09/msg00016.html

8 years agogetprogname-tests: work also when EXEEXT is nonempty
Jim Meyering [Wed, 7 Sep 2016 18:03:03 +0000 (11:03 -0700)]
getprogname-tests: work also when EXEEXT is nonempty

* modules/getprogname-tests (Makefile.am): Define EXEEXT.
* tests/test-getprogname.c (main): Use it.
Suggested by Gisle Vanem.

8 years agogetprogname: fix errors in previous change
Gisle Vanem [Wed, 7 Sep 2016 17:45:03 +0000 (10:45 -0700)]
getprogname: fix errors in previous change

* lib/getprogname.c (getprogname) [HAVE_GETEXECNAME]:
s/program_invocation_name/base/
[HAVE_DECL___ARGV]: Handle NULL __argv or __argv[0].

8 years agoparse-datetime: restrict debug output to input string
Pádraig Brady [Thu, 8 Sep 2016 14:17:10 +0000 (15:17 +0100)]
parse-datetime: restrict debug output to input string

* lib/parse-datetime.y (parse_datetime2): If we parse
all of the input but determine it's invalid, ensure
we don't output the now invalid input pointer.
This issue was seen with `date -d 'now +1'`.

8 years agoflexmember: new macro FLEXALIGNOF
Paul Eggert [Wed, 7 Sep 2016 23:42:13 +0000 (16:42 -0700)]
flexmember: new macro FLEXALIGNOF

* lib/flexmember.h: Include <stddef.h>, for offsetof.
(FLEXALIGNOF): Rename from _GL_XALLOC_ALIGNOF, as Emacs can use
this macro.  Update comments.

8 years agogetprogname: port to systems with __argv (mingw, msvc)
Jim Meyering [Wed, 7 Sep 2016 14:57:47 +0000 (07:57 -0700)]
getprogname: port to systems with __argv (mingw, msvc)

* lib/getprogname.c (getprogname): Include "dirname.h" and use
last_component: more general than open coding it with hard-coded "/".
* lib/getprogname.h (getprogname): Prefer "char const *" consistently.
* modules/getprogname (Depends-on): Add dirname-lgpl.
(configure.ac): Check for __argv in <stdlib.h>.
* modules/getprogname-tests: New file.
* tests/test-getprogname.c: New file.
Suggested by Gisle Vanem in
https://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00014.html

8 years agoflexmember: port better to GCC + valgrind
Paul Eggert [Wed, 7 Sep 2016 09:01:42 +0000 (02:01 -0700)]
flexmember: port better to GCC + valgrind

With a char[] flexible array member in a struct with nontrivial
alignment, GCC-generated code can access past the end of the
array, because GCC assumes there are padding bytes to get the
struct aligned.  So the common idiom of malloc (offsetof (struct
s, m), n) does not properly allocate an n-byte trailing member, as
malloc’s argument should be the next multiple of alignof (struct s).
See GCC Bug#66661: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66661
Although C11 apparently permits this GCC optimization (i.e., there
was a bug in Gnulib not in GCC), possibly this is a defect in C11.
See the thread containing:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00317.html
* lib/flexmember.h: New file.
* lib/fnmatch.c, lib/fts.c, lib/glob.c, lib/idcache.c:
* lib/localename.c, lib/time_rz.c:
Include flexmember.h.
* lib/fnmatch_loop.c (struct patternlist):
* lib/localename.c (struct hash_node):
Use FLEXIBLE_ARRAY_MEMBER.
* lib/fnmatch_loop.c (EXT):
* lib/fts.c (fts_alloc):
* lib/glob.c (glob_in_dir):
* lib/idcache.c (getuser, getuidbyname, getgroup, getgidbyname):
* lib/localename.c (gl_lock_define_initialized):
* lib/time_rz.c (tzalloc):
Use FLEXSIZEOF instead of offsetof.
* m4/flexmember.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER):
Check that the size of the struct can be taken.
* modules/flexmember (Files): Add lib/flexmember.h.
* modules/fnmatch, modules/glob, modules/localename (Depends-on):
Add flexmember.

8 years agogetprogname: port to Solaris 10
Paul Eggert [Wed, 7 Sep 2016 06:56:26 +0000 (23:56 -0700)]
getprogname: port to Solaris 10

* lib/getprogname.c: Include stdlib.h, for getexecname decl.
(getprogname) [HAVE_GETEXECNAME]: Use that, for Solaris 10.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Check for getexecname.

8 years agostdalign: correct mistake in alignof doc
Paul Eggert [Tue, 6 Sep 2016 21:26:05 +0000 (14:26 -0700)]
stdalign: correct mistake in alignof doc

Problem reported by Joseph Myers in:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00340.html
* doc/posix-headers/stdalign.texi: Do not imply that C11 prohibits
alignof(S) where S is a structure containing a flexible array
member.  The Gnulib substitute does not support this, but C11 does.

8 years agogetprogname.h: declare with _GL_ATTRIBUTE_PURE, when required
Jim Meyering [Tue, 6 Sep 2016 04:40:57 +0000 (21:40 -0700)]
getprogname.h: declare with _GL_ATTRIBUTE_PURE, when required

* lib/getprogname.h (getprogname) [HAVE_DECL_PROGRAM_INVOCATION_NAME]:
Declare with _GL_ATTRIBUTE_PURE, to avoid warning from gcc's
-Wsuggest-attribute=pure

8 years agomain.mk: remove sc_program_name
Pino Toscano [Thu, 18 Aug 2016 13:18:25 +0000 (15:18 +0200)]
main.mk: remove sc_program_name

There is no more need to use set_program_name in tools (getprogname
is enough for most of the cases).
* cfg.mk (local-checks-to-skip): Remove sc_program_name.
* top/maint.mk (sc_program_name): Remove.

8 years agoPort tests away from progname
Pino Toscano [Thu, 18 Aug 2016 13:18:24 +0000 (15:18 +0200)]
Port tests away from progname

Modules that need the program name already
depend on getprogname.
* modules/acl-tests (Depends-on): Remove progname.
* modules/argmatch (Depends-on): Likewise.
* modules/argmatch-tests (Depends-on): Likewise.
* modules/argp-tests (Depends-on): Likewise.
* modules/argp-version-etc-tests (Depends-on): Likewise.
* modules/array-list-tests (Depends-on): Likewise.
* modules/array-oset-tests (Depends-on): Likewise.
* modules/avltree-list-tests (Depends-on): Likewise.
* modules/avltree-oset-tests (Depends-on): Likewise.
* modules/avltreehash-list-tests (Depends-on): Likewise.
* modules/carray-list-tests (Depends-on): Likewise.
* modules/copy-file-tests (Depends-on): Likewise.
* modules/exclude-tests (Depends-on): Likewise.
* modules/fchownat-tests (Depends-on): Likewise.
* modules/fdopendir-tests (Depends-on): Likewise.
* modules/filenamecat-tests (Depends-on): Likewise.
* modules/fstatat-tests (Depends-on): Likewise.
* modules/fstrcmp-tests (Depends-on): Likewise.
* modules/linked-list-tests (Depends-on): Likewise.
* modules/linkedhash-list-tests (Depends-on): Likewise.
* modules/mkdirat-tests (Depends-on): Likewise.
* modules/nonblocking-pipe-tests (Depends-on): Likewise.
* modules/nonblocking-socket-tests (Depends-on): Likewise.
* modules/obstack-printf-tests (Depends-on): Likewise.
* modules/openat-tests (Depends-on): Likewise.
* modules/parse-datetime-tests (Depends-on): Likewise.
* modules/pipe-filter-gi-tests (Depends-on): Likewise.
* modules/pipe-filter-ii-tests (Depends-on): Likewise.
* modules/quotearg-simple-tests (Depends-on): Likewise.
* modules/quotearg-tests (Depends-on): Likewise.
* modules/rbtree-list-tests (Depends-on): Likewise.
* modules/rbtree-oset-tests (Depends-on): Likewise.
* modules/rbtreehash-list-tests (Depends-on): Likewise.
* modules/spawn-pipe-tests (Depends-on): Likewise.
* modules/system-quote-tests (Depends-on): Likewise.
* modules/uniname/uniname-tests (Depends-on): Likewise.
* modules/uninorm/nfc-tests (Depends-on): Likewise.
* modules/uninorm/nfd-tests (Depends-on): Likewise.
* modules/uninorm/nfkc-tests (Depends-on): Likewise.
* modules/uninorm/nfkd-tests (Depends-on): Likewise.
* modules/unistdio/u16-vsnprintf-tests (Depends-on): Likewise.
* modules/unistdio/u16-vsprintf-tests (Depends-on): Likewise.
* modules/unistdio/u32-vsnprintf-tests (Depends-on): Likewise.
* modules/unistdio/u32-vsprintf-tests (Depends-on): Likewise.
* modules/unistdio/u8-vsnprintf-tests (Depends-on): Likewise.
* modules/unistdio/u8-vsprintf-tests (Depends-on): Likewise.
* modules/unistdio/ulc-vsnprintf-tests (Depends-on): Likewise.
* modules/unistdio/ulc-vsprintf-tests (Depends-on): Likewise.
* modules/unlinkat-tests (Depends-on): Likewise.
* modules/version-etc-tests (Depends-on): Likewise.
* modules/xalloc-die-tests (Depends-on): Likewise.
* modules/xmemdup0-tests (Depends-on): Likewise.
* modules/xprintf-posix-tests (Depends-on): Likewise.
* modules/xvasprintf-tests (Depends-on): Likewise.
* tests/test-argmatch.c: Do not include progname.h.
(main) Stop calling set_program_name.
* tests/test-argp-version-etc.c: Likewise.
* tests/test-argp.c: Likewise.
* tests/test-argv-iter.c: Likewise.
* tests/test-array_list.c: Likewise.
* tests/test-array_oset.c: Likewise.
* tests/test-avltree_list.c: Likewise.
* tests/test-avltree_oset.c: Likewise.
* tests/test-avltreehash_list.c: Likewise.
* tests/test-carray_list.c: Likewise.
* tests/test-copy-acl.c: Likewise.
* tests/test-copy-file.c: Likewise.
* tests/test-exclude.c: Likewise.
* tests/test-fchownat.c: Likewise.
* tests/test-fdopendir.c: Likewise.
* tests/test-filenamecat.c: Likewise.
* tests/test-fstatat.c: Likewise.
* tests/test-fstrcmp.c: Likewise.
* tests/test-linked_list.c: Likewise.
* tests/test-linkedhash_list.c: Likewise.
* tests/test-mkdirat.c: Likewise.
* tests/test-nonblocking-pipe-main.c: Likewise.
* tests/test-nonblocking-socket-main.c: Likewise.
* tests/test-obstack-printf.c: Likewise.
* tests/test-openat.c: Likewise.
* tests/test-parse-datetime.c: Likewise.
* tests/test-pipe-filter-gi1.c: Likewise.
* tests/test-pipe-filter-gi2-main.c: Likewise.
* tests/test-pipe-filter-ii1.c: Likewise.
* tests/test-pipe-filter-ii2-main.c: Likewise.
* tests/test-quotearg-simple.c: Likewise.
* tests/test-quotearg.c: Likewise.
* tests/test-rbtree_list.c: Likewise.
* tests/test-rbtree_oset.c: Likewise.
* tests/test-rbtreehash_list.c: Likewise.
* tests/test-sameacls.c: Likewise.
* tests/test-set-mode-acl.c: Likewise.
* tests/test-spawn-pipe-main.c: Likewise.
* tests/test-system-quote-main.c: Likewise.
* tests/test-unlinkat.c: Likewise.
* tests/test-version-etc.c: Likewise.
* tests/test-xalloc-die.c: Likewise.
* tests/test-xfprintf-posix.c: Likewise.
* tests/test-xmemdup0.c: Likewise.
* tests/test-xprintf-posix.c: Likewise.
* tests/test-xvasprintf.c: Likewise.
* tests/uniname/test-uninames.c: Likewise.
* tests/uninorm/test-u32-nfc-big.c: Likewise.
* tests/uninorm/test-u32-nfd-big.c: Likewise.
* tests/uninorm/test-u32-nfkc-big.c: Likewise.
* tests/uninorm/test-u32-nfkd-big.c: Likewise.
* tests/unistdio/test-u16-vsnprintf1.c: Likewise.
* tests/unistdio/test-u16-vsprintf1.c: Likewise.
* tests/unistdio/test-u32-vsnprintf1.c: Likewise.
* tests/unistdio/test-u32-vsprintf1.c: Likewise.
* tests/unistdio/test-u8-vsnprintf1.c: Likewise.
* tests/unistdio/test-u8-vsprintf1.c: Likewise.
* tests/unistdio/test-ulc-vsnprintf1.c: Likewise.
* tests/unistdio/test-ulc-vsprintf1.c: Likewise.
* tests/test-c-stack.c: (program_name): Do not define.
(main): Do not set program_name.
* tests/test-closein.c: Likewise.
* tests/test-xstrtol.c: Likewise.
* tests/test-yesno.c: Likewise.

8 years agoPort modules to use getprogname explicitly
Pino Toscano [Thu, 18 Aug 2016 13:18:23 +0000 (15:18 +0200)]
Port modules to use getprogname explicitly

... instead of requiring progname to be used (or program_name to be
provided).
* lib/argmatch.c: Do not include progname.h.
[TEST] (program_name): Do not define.
[TEST] (main): Call getprogname instead of using program_name.
* lib/c-stack.c: Do not include progname.h.
(program_name): Do not define.
(die): Call getprogname instead of using program_name.
* lib/chdir-long.c: Do not include progname.h.
[TEST_CHDIR] (main): Do not set program_name.
* lib/error.c [!_LIBC]: Include progname.h.
[!_LIBC] (program_name): Define using getprogname.
* lib/euidaccess.c: Do not include progname.h.
[TEST] (main): Do not set program_name.
* lib/git-merge-changelog.c: Include getprogname.h instead of
progname.h.
(usage): Call getprogname instead of using program_name.
(main): Likewise.  Stop calling set_program_name.
* lib/group-member.c: Do not include progname.h.
[TEST] (main): Do not set program_name.
* modules/argmatch (Depends-on): Add getprogname.
* modules/c-stack (Depends-on): Likewise.
* modules/error (Depends-on): Likewise.
* modules/git-merge-changelog (Depends-on): Likewise.
Also remove progname.

8 years agogetprogname: new module
Pino Toscano [Thu, 18 Aug 2016 13:18:22 +0000 (15:18 +0200)]
getprogname: new module

This provides a LGPL module for getting the name of the current
program, using the same API found on *BSD systems.
* lib/getprogname.c, lib/getprogname.h, m4/getprogname.m4:
* modules/getprogname: New files.
* MODULES.html.sh (Misc): Add getprogname.
* NEWS: Document the deprecation of the 'progname' module.

8 years agoautoupdate
Karl Berry [Mon, 5 Sep 2016 13:39:15 +0000 (06:39 -0700)]
autoupdate

8 years agomanywarnings: add -fno-common
Jim Meyering [Fri, 2 Sep 2016 16:16:16 +0000 (09:16 -0700)]
manywarnings: add -fno-common

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fno-common
to the list.  Quoting the manual, "Compiling with -fno-common is
useful on targets for which it provides better performance, or if
you wish to verify that the program will work on other systems that
always treat uninitialized variable declarations this way [putting
it in the data section]."  If diffutils had been using this sooner,
it would have prevented this duplicate declaration issue:
http://git.sv.gnu.org/cgit/diffutils.git/commit/?id=v3.4-10-gc2dc91f

8 years agoparse-datetime: Fix typo.
Simon Josefsson [Wed, 31 Aug 2016 12:27:04 +0000 (14:27 +0200)]
parse-datetime: Fix typo.

* lib/parse-datetime.y (parse_datetime2): Fix typo.

8 years agointprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6
Paul Eggert [Tue, 30 Aug 2016 19:29:21 +0000 (12:29 -0700)]
intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6

* lib/intprops.h (INT_NEGATE_OVERFLOW): Tune for platforms like
GCC 5 and 6 that have __builtin_sub_overflow but not
__builtin_sub_overflow_p.  With the recent changes, these
platforms are a tiny bit faster with the INT_NEGATE_RANGE_OVERFLOW
implementation than with INT_SUBTRACT_OVERFLOW implementation,
since the former needs just one runtime comparison whereas the
latter needs two.

8 years agostrverscmp: sync with glibc
Paul Eggert [Tue, 30 Aug 2016 15:23:44 +0000 (08:23 -0700)]
strverscmp: sync with glibc

Although this doesn't exactly synchronize with glibc
byte-for-byte, it makes the code behave the same as glibc.
* lib/strverscmp.c (S_I, S_F, S_Z): Now masks, not powers of 2.
(ISDIGIT): Remove, as glibc is sticking with isdigit, and the
difference shouldn't matter in practical use.  All uses changed
back to isdigit.
(__strverscmp, strverscmp): Use new glibc method for weak aliases.
(next_state): Now unsigned char array; redo elements.
(result_type): Now signed char array; redo elements.
(__strverscmp): Fix glibc bug 9913 by using new states.
* tests/test-strverscmp.c (main): Test glibc bug 9913.

8 years agoxalloc-oversized.h: port __builtin_mul_overflow change to GCC 6.2.0
Jim Meyering [Mon, 29 Aug 2016 23:33:43 +0000 (16:33 -0700)]
xalloc-oversized.h: port __builtin_mul_overflow change to GCC 6.2.0

* lib/xalloc-oversized.h: Port this change to GCC 6.2.0, too,
similarly to how it was done to intprops.h.

8 years agointprops.h: port recent changes to GCC 6.2.0
Paul Eggert [Mon, 29 Aug 2016 19:03:51 +0000 (12:03 -0700)]
intprops.h: port recent changes to GCC 6.2.0

* lib/intprops.h (__has_builtin): Move earlier.
(_GL_HAS_BUILTIN_OVERFLOW): Rename from
_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL and don't worry about whether
the last argument can be null.  All uses changed.
(_GL_HAS_BUILTIN_OVERFLOW_P): Also test __has_builtin.
(_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW):
Don't try to use 3rd arg null, as this doesn't work on GCC 6.2.0
and it's not clear which GCC versions it works for.
(_GL_INT_OP_WRAPV): Use _GL_HAS_BUILTIN_OVERFLOW instead of
its definiens.

8 years agointprops.h: use __typeof__ with GCC 7
Paul Eggert [Mon, 29 Aug 2016 17:08:32 +0000 (10:08 -0700)]
intprops.h: use __typeof__ with GCC 7

* lib/intprops.h (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW)
(_GL_MULTIPLY_OVERFLOW): Use __typeof__ as in the GCC manual.
This avoids computing the expression's value (which might overflow!).

8 years agointprops.h, xalloc-oversized.h: work with gcc 7
Jim Meyering [Mon, 29 Aug 2016 16:45:18 +0000 (09:45 -0700)]
intprops.h, xalloc-oversized.h: work with gcc 7

In gcc 6, __builtin_add_overflow, __builtin_sub_overflow and
__builtin_mul_overflow each accept a NULL pointer as the third
argument.  However in gcc 7, that is no longer accepted.
Instead, one must use the "_p"-suffixed names, with which, the
third parameter is no longer a pointer.
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL): Correct
the definition: not true for gcc 7 and subsequent.
(_GL_HAS_BUILTIN_OVERFLOW_P): Define.
(_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW):
Provide new definitions for gcc 7 and subsequent.
* lib/xalloc-oversized.h (xalloc_oversized): Provide a definition
that works with gcc-7.

8 years agointprops.h: fix missing-backslash problems
Jim Meyering [Mon, 29 Aug 2016 16:27:50 +0000 (09:27 -0700)]
intprops.h: fix missing-backslash problems

* lib/intprops.h (_GL_ADD_OVERFLOW): Add backslash.
(_GL_SUBTRACT_OVERFLOW,_GL_MULTIPLY_OVERFLOW): Likewise.

8 years agoautoupdate
Karl Berry [Fri, 26 Aug 2016 13:33:31 +0000 (06:33 -0700)]
autoupdate

8 years agointprops: fix paren typo on old platforms
Paul Eggert [Thu, 25 Aug 2016 05:24:48 +0000 (22:24 -0700)]
intprops: fix paren typo on old platforms

Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300#13
* lib/intprops.h (_GL_INT_OP_WRAPV_LONGISH)
[__GNUC__ < 5 && !__has_builtin (__builtin_add_overflow)
&& (__STDC_VERSION__ < 201112 || _GL__GENERIC_BOGUS)
&& !defined LLONG_MAX]:
Remove stray paren.

8 years agointprops: port to OpenVMS
Paul Eggert [Thu, 25 Aug 2016 03:48:32 +0000 (20:48 -0700)]
intprops: port to OpenVMS

Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300
* doc/posix-headers/limits.texi: Document the problem.
* lib/intprops.h (LLONG_MAX, LLONG_MIN) [__INT64_MAX]:
Define if not already defined.

8 years agoparse-datetime: improve debug implementation
Assaf Gordon [Mon, 15 Aug 2016 01:29:50 +0000 (21:29 -0400)]
parse-datetime: improve debug implementation

Follow-up to commit 12ad79069 ("add optional debug printing").
Improve parse-datetime's debug implementation: remove macros,
replace global debug flag variable with a function parameter,
use nstrftime for formatting.
See: https://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00021.html

* lib/parse-datetime.h: (parse_datetime_debug): Remove global extern
declaration.
(parse_datetime2): New function, accepts 'flags' parameter, supporting
debug flag. Existing interface 'parse_datetime' left unmodified.
* lib/parse-datetime.c: (parse_datetime_debug): Remove global variable.
(struct parser_control): add 'parse_datetime_debug' member variable.
(parse_datetime): Call new function 'parse_datetime2' without debug.
(parse_datetime2): Adapted from previous 'parse_datetime', initialize
pc.parse_datetime_debug variable as needed.
(to_year): Accept new flags parameter, instead of using global variable.
(debug_print_current_time,debug_print_relative_time,debug_mktime_not_ok):
use struct 'debug' variable instead of global variable.
(DEBUG,DEBUG_PRINT_CURRENT_TIME,DEBUG_PRINT_RELATIVE_TIME,
DEBUG_MKTIME_NOT_OK,PROGRESS,PROGRESS0): Remove macros. Call
correspnding functions directly instead of using macros.
* modules/parse-datetime: Add gnulib's strftime module.

8 years agoc-strcase-tests: port to EBCDIC
Daniel Richard G [Fri, 19 Aug 2016 19:24:03 +0000 (12:24 -0700)]
c-strcase-tests: port to EBCDIC

* tests/test-c-strncasecmp.c: Allow two c_strncasecmp calls
which assume ASCII encoding semantics to run only in ASCII
mode, as they fail in EBCDIC.

8 years agosigpipe-tests: fix typo
Daniel Richard G [Fri, 19 Aug 2016 19:22:13 +0000 (12:22 -0700)]
sigpipe-tests: fix typo

* tests/test-sigpipe.sh: C, not B.

8 years agocanonicalize-lgpl: fix errno after malloca fails
Paul Eggert [Thu, 18 Aug 2016 18:56:07 +0000 (11:56 -0700)]
canonicalize-lgpl: fix errno after malloca fails

This fixes a typo I recently introduced.  Suggested by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00039.html
* lib/canonicalize-lgpl.c (__realpath):
Don't assume malloca sets errno on failure.

8 years agostrtod: port errno handling to z/OS
Paul Eggert [Thu, 18 Aug 2016 00:38:05 +0000 (17:38 -0700)]
strtod: port errno handling to z/OS

* lib/strtod.c (strtod): Save and restore errno more reliably.

8 years agostrtod: port to z/OS
Daniel Richard G [Thu, 18 Aug 2016 00:36:24 +0000 (17:36 -0700)]
strtod: port to z/OS

* lib/strtod.c (strtod): Address a couple quirks in the z/OS
implementation.

strtod: port to z/OS
* lib/strtod.c (strtod): Address a couple quirks in the z/OS
implementation.

8 years agoregex, string: rename to avoid '__string'
Paul Eggert [Thu, 18 Aug 2016 00:24:11 +0000 (17:24 -0700)]
regex, string: rename to avoid '__string'

* lib/regex.h, lib/string.in.h: Do not use the identifier
'__string', as it is effectively reserved by string.h on z/OS.

8 years agoc-strcase-tests, wcwidth-tests: depend on c-ctype
Paul Eggert [Thu, 18 Aug 2016 00:18:22 +0000 (17:18 -0700)]
c-strcase-tests, wcwidth-tests: depend on c-ctype

* modules/c-strcase-tests, modules/wcwidth-tests (Depends-on):
Add c-ctype.

8 years agothread: port to z/OS
Daniel Richard G [Wed, 17 Aug 2016 23:59:39 +0000 (16:59 -0700)]
thread: port to z/OS

* lib/glthread/thread.c, lib/glthread/thread.h:
Rudimentary gl_thread support for z/OS.

8 years agomaint: port tests to z/OS errno behavior
Daniel Richard G [Wed, 17 Aug 2016 23:57:35 +0000 (16:57 -0700)]
maint: port tests to z/OS errno behavior

* tests/test-nonblocking-reader.h:
* tests/test-nonblocking-writer.h:
Accommodate z/OS errno code preferences. (I believe this should
still be within spec; IBM is good at following the letter if not
the spirit of such things.)

8 years agomaint: preprocessor changes to support z/OS
Daniel Richard G [Wed, 17 Aug 2016 23:55:13 +0000 (16:55 -0700)]
maint: preprocessor changes to support z/OS

* lib/alloca.in.h, lib/fnmatch.c, lib/get-rusage-as.c:
* lib/glob.c, lib/math.in.h, lib/ptsname_r.c:
* tests/infinity.h, tests/nan.h, tests/test-canonicalize-lgpl.c:
* tests/test-nonblocking-pipe.h:

8 years agofclose, strstr-simple, wchar: port to z/OS
Daniel Richard G [Wed, 17 Aug 2016 23:09:38 +0000 (16:09 -0700)]
fclose, strstr-simple, wchar: port to z/OS

* m4/fclose.m4, m4/strstr.m4, m4/wchar_h.m4:
Changes to the Autoconf M4 code to support z/OS.  Note that
fclose() is broken in a different way on z/OS than it is on other
systems, thus the special-case in fclose.m4.

8 years agoiconv_open-utf-tests, iconv-tests: port to EBCDIC
Daniel Richard G [Wed, 17 Aug 2016 23:05:02 +0000 (16:05 -0700)]
iconv_open-utf-tests, iconv-tests: port to EBCDIC

* tests/test-iconv-utf.c, tests/test-iconv.c:
Added appropriately conditional #pragmas so that the test strings
in test-iconv-utf.c are correctly interpreted in ASCII instead of
EBCDIC (i.e. 'J' == 0x4A and not 0xD1). This issue could be
addressed in a more portable way by simply rewriting all the ASCII
literal characters as octal escapes, but then you would lose the
partial readability that the strings have now. Also, iconv_open()
on z/OS does not recognize "ISO-8859-1", but "ISO8859-1" works.

8 years agoc-strcase-tests, wcwidth-tests: port to EBCDIC
Daniel Richard G [Wed, 17 Aug 2016 22:58:01 +0000 (15:58 -0700)]
c-strcase-tests, wcwidth-tests: port to EBCDIC

* tests/test-c-strcasecmp.c: Include c-ctype.h.
(main) [!C_CTYPE_ASCII]: Skip tests that assume ASCII.
* tests/test-wcwidth.c: Likewise.