]> Savannah Git Hosting - gnulib.git/log
gnulib.git
9 years agointprops: fix typo in clang port
Paul Eggert [Tue, 10 Nov 2015 17:35:16 +0000 (09:35 -0800)]
intprops: fix typo in clang port

* lib/intprops.h (_GL_INT_OP_WRAPV): Fix misspelling of
'__builtin_add_overflow' that is not caught by compiler.

9 years agotest-timespec: fix typo in previous change
Paul Eggert [Fri, 6 Nov 2015 02:32:03 +0000 (18:32 -0800)]
test-timespec: fix typo in previous change

* tests/test-timespec.c (main): Fix typo that reduced test quality.

9 years agotimespec-sub: fix overflow bug; add tests
Paul Eggert [Fri, 6 Nov 2015 01:41:43 +0000 (17:41 -0800)]
timespec-sub: fix overflow bug; add tests

* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Work even if time_t is narrower than int (a theoretical
possibility).  Redo code for a bit more clarity.
* lib/timespec-sub.c (timespec_sub):
Fix off-by-2 bug if a.tv_sec == TYPE_MINIMUM (time_t) and 0 < b.tv_sec.
* modules/timespec-tests, tests/test-timespec.c: New files.

9 years agointprops-test: suppress -Woverlength-strings
Paul Eggert [Thu, 5 Nov 2015 15:46:32 +0000 (07:46 -0800)]
intprops-test: suppress -Woverlength-strings

Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00008.html
It is not worth the hassle to port this test to compilers that
cannot handle long strings in diagnostics.
* tests/test-intprops.c [__GNUC__]: Ignore -Woverlength-strings.

9 years agomaint: add missing ChangeLog entry for previous commit
Pádraig Brady [Wed, 4 Nov 2015 23:21:03 +0000 (23:21 +0000)]
maint: add missing ChangeLog entry for previous commit

9 years agoquotearg: add quotearg_n_style_colon()
Pádraig Brady [Wed, 4 Nov 2015 23:01:25 +0000 (23:01 +0000)]
quotearg: add quotearg_n_style_colon()

This quotes with default options of the specified style,
but with quoting enabled for instances of ':'.

While this can be simulated by temporarily modifying
the default quoting style, this is a little awkward,
and care must be taken with such an implementation
to avoid inlining leading to bloated text.

* lib/quotearg.h (quotearg_n_style_colon): Description and declaration.
* lib/quotearg.c (quotearg_n_style_colon): New function implementation.

9 years agointprops: revise _WRAPV macros, revert _OVERFLOW
Paul Eggert [Wed, 4 Nov 2015 16:27:57 +0000 (08:27 -0800)]
intprops: revise _WRAPV macros, revert _OVERFLOW

The incompatible changes to the _OVERFLOW macros were too much of
a hassle in practice, so revert them.  Instead, change the new
_WRAPV macros to make them closer in behavior to GCC 5's new
builtin_add_overflow etc. functions.  No other software was using
these newly-added macros yet, so this should be OK.
* NEWS: Revert previous change, since the incompatible change
has been reverted, and nobody used the incompatible version.
* doc/intprops.texi (Wraparound Arithmetic, Integer Type Overflow):
Document revised behavior.
(Integer Range Overflow): Adjust example to match above revisions.
* lib/intprops.h (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW)
(INT_MULTIPLY_OVERFLOW): Revert previous change, so that
these can be used in integer constant expressions again.
(INT_CONST_ADD_OVERFLOW, INT_CONST_SUBTRACT_OVERFLOW)
(INT_CONST_MULTIPLY_OVERFLOW): Remove, as these are no longer
needed.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, INT_LEFT_SHIFT_WRAPV):
Remove, as they did not seem that useful.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV)
(_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH)
(_GL_INT_OP_WRAPV_VIA_UNSIGNED):
Support new semantics.
(__has_builtin): New macro, if not alreay defined.
(_GL__GENERIC_BOGUS, _GL_INT_OP_CALC, _GL_INT_OP_CALC1): New macros.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): Remove.
(CHECK_SBINOP, CHECK_SSUM, CHECK_SUM1, CHECK_SSUM1)
(CHECK_SDIFFERENCE, CHECK_SPRODUCT, CHECK_PRODUCT1, CHECK_SPRODUCT1):
New macros.
(CHECK_BINOP, CHECK_UNOP, main, CHECK_SUM): Test new behavior.

9 years agointprops: add parentheses for when OP has precedence lower than "-"
Jim Meyering [Tue, 3 Nov 2015 16:32:27 +0000 (08:32 -0800)]
intprops: add parentheses for when OP has precedence lower than "-"

* lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): In "a OP b - c",
"a OP b" must be parenthesized for when OP is like "<<", which has
lower precedence than the following "-". Reported by Pádraig Brady.

9 years agoquotearg: constify get_quoting_style parameters
Pádraig Brady [Tue, 3 Nov 2015 10:59:55 +0000 (10:59 +0000)]
quotearg: constify get_quoting_style parameters

* lib/quotearg.h (get_quoting_style): Mark parameter as const.
* lib/quotearg.c (get_quoting_style): Likewise.

9 years agoquotearg: add support for $'' shell escaping
Pádraig Brady [Fri, 30 Oct 2015 22:49:16 +0000 (22:49 +0000)]
quotearg: add support for $'' shell escaping

* lib/quotearg.h: Add "shell-escape" and "shell-escape-always"
items and descriptions.
* lib/quotearg.c (quotearg_buffer_restyled): Add support for the
above types by quoting like "shell", but using $'...' syntax
for non printable characters, which should provide unambiguous
printable output for any input.
* tests/test-quotearg-simple.c: Update accordingly.

9 years agomaint: use a more standard return from mbrtowc test
Pádraig Brady [Mon, 2 Nov 2015 11:25:47 +0000 (11:25 +0000)]
maint: use a more standard return from mbrtowc test

* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Don't return 1
from the test program as this is non standard and often
indicates an unhandled case in the test program.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): Likewise.

9 years agointprops: add WRAPV and const flavors for GCC 5
Paul Eggert [Fri, 30 Oct 2015 20:45:26 +0000 (13:45 -0700)]
intprops: add WRAPV and const flavors for GCC 5

If available, use GCC 5's builtin functions for efficient integer
overflow checking.  Also, add macros like INT_ADD_WRAPV that efficently
and safely compute the low-order bits of the correct answer.
A downside of these efficient functions is that they cannot be
used in constant expressions, so add macros like INT_CONST_ADD_OVERFLOW
and INT_CONST_ADD_WRAPV that can be used even in constant expressions.
* NEWS: Document the incompatible changes to INT_ADD_OVERFLOW etc.
* doc/intprops.texi (Integer Properties, Integer Type Overflow):
Document the changes.
(Wraparound Arithmetic): New section.
(Integer Range Overflow):
Put this subsection last, since it's least useful.
* lib/intprops.h (INT_CONST_ADD_OVERFLOW)
(INT_CONST_SUBTRACT_OVERFLOW, INT_CONST_MULTIPLY_OVERFLOW):
New macros, with the meaning that INT_ADD_OVERFLOW etc. used to have.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, _GL_INT_OP_WRAPV, _GL_EXPR_CAST)
(_GL_INT_OP_WRAPV_LONGISH, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV, _GL_OP_OVERFLOW, _GL_OP_WRAPV, _GL_OP_WRAPV_GENSYM):
New macros.
(INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW, INT_MULTIPLY_OVERFLOW):
Generate calls to GCC builtins if available, for speed.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): New macros.
(main, CHECK_BINOP, CHECK_UNOP, CHECK_SUM, CHECK_PRODUCT)
(CHECK_QUOTIENT, CHECK_REMAINDER):
Test WRAPV and CONST flavors (when available) too.

9 years agodoc: use extended timezone format in iso-8601 example
Pádraig Brady [Fri, 23 Oct 2015 02:15:40 +0000 (03:15 +0100)]
doc: use extended timezone format in iso-8601 example

* doc/parse-datetime.texi: The standard states that extended
format (separated with ':') is to be used consistently throughout.
Note that lib/parse-datetime.y can handle either tz format.

9 years agoupdate from texinfo
Karl Berry [Fri, 30 Oct 2015 15:40:41 +0000 (08:40 -0700)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Tue, 27 Oct 2015 15:34:31 +0000 (08:34 -0700)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Mon, 26 Oct 2015 14:02:41 +0000 (07:02 -0700)]
update from texinfo

9 years agostdalign: port to Sun C 5.9
Paul Eggert [Sun, 25 Oct 2015 08:10:47 +0000 (01:10 -0700)]
stdalign: port to Sun C 5.9

* doc/posix-headers/stdalign.texi: Document this.
* lib/stdalign.in.h (_Alignas): Sun C 5.9 also supports
__attribute__ ((__aligned__ (...))).

9 years agoautoupdate
Karl Berry [Sat, 24 Oct 2015 12:30:54 +0000 (05:30 -0700)]
autoupdate

9 years agoupdate from texinfo
Karl Berry [Thu, 22 Oct 2015 13:01:11 +0000 (06:01 -0700)]
update from texinfo

9 years agoautoupdate
Karl Berry [Wed, 21 Oct 2015 13:44:22 +0000 (06:44 -0700)]
autoupdate

9 years agotime_rz: fix comment about tzalloc
Paul Eggert [Wed, 21 Oct 2015 06:16:52 +0000 (23:16 -0700)]
time_rz: fix comment about tzalloc

* lib/time_rz.c (tzalloc): Fix comment.

9 years agoupdate from texinfo
Karl Berry [Tue, 20 Oct 2015 14:43:59 +0000 (07:43 -0700)]
update from texinfo

9 years agostdalign: work around pre-4.9 GCC x86 bug
Paul Eggert [Mon, 19 Oct 2015 05:18:49 +0000 (22:18 -0700)]
stdalign: work around pre-4.9 GCC x86 bug

* lib/stdalign.in.h (_Alignof): Work around bug in pre-4.9 GCC on
x86, when -std=gnu11 is used.  Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-10/msg00038.html

9 years agomaint.mk: sc_tight_scope: remove extraneous expressions
Pádraig Brady [Sun, 18 Oct 2015 20:15:35 +0000 (21:15 +0100)]
maint.mk: sc_tight_scope: remove extraneous expressions

* top/maint.mk (tight_scope): This is not really required since
commit 3ef58f46 as sed_wrap ensures we don't get an empty expression
that matches all nm entries.  But it does remove extraneous entries
that may be confusing or cause issue in future maintenance.

9 years agotime_rz: return NULL if localtime_r fails
Paul Eggert [Sun, 18 Oct 2015 17:24:37 +0000 (10:24 -0700)]
time_rz: return NULL if localtime_r fails

* lib/time_rz.c (localtime_rz): Return NULL if localtime_r fails,
while still attempting to pacify bleeding-edge GCC.

9 years agofts: port to C11 alignof
Paul Eggert [Sun, 18 Oct 2015 16:52:45 +0000 (09:52 -0700)]
fts: port to C11 alignof

* doc/posix-headers/stdalign.texi (stdalign.h):
Document the C11 restriction.
* lib/fts.c: Include stddef.h, for max_align_t.
(fts_alloc): Align using max_align_t, not FTSENT.
* modules/fts (Depends-on): Add stddef.

9 years agotime_rz: avoid warning from bleeding-edge gcc's -Wnonnull
Jim Meyering [Sun, 18 Oct 2015 16:32:21 +0000 (09:32 -0700)]
time_rz: avoid warning from bleeding-edge gcc's -Wnonnull

Compiling with gcc version 6.0.0 20151017 (experimental) (GCC), I
would see this:

lib/time_rz.c: In function 'localtime_rz':
lib/time_rz.c:292:15: error: nonnull argument 'tm' compared to NULL \
  [-Werror=nonnull]
           if (tm && !save_abbr (tz, tm))
               ^

That was complaining about "tm" because it is a parameter that was
declared with the __nonnull__ attribute.
* lib/time_rz.c (localtime_rz): Don't bother setting "tm" to the
result of localtime_r.

9 years agomaint.mk: _gl_TS_function_match: fix "extern" name extracting regexp
Jim Meyering [Sun, 18 Oct 2015 02:18:01 +0000 (19:18 -0700)]
maint.mk: _gl_TS_function_match: fix "extern" name extracting regexp

* top/maint.mk (_gl_TS_function_match): This heuristic extern-function-
name-extraction regexp mistakenly used \S+, and would mistakenly
extract "*F" from "extern int *F()" rather than the desired "F".
Use \w+ instead.

9 years agomaint.mk: sc_tight_scope: factor and support OS X
Jim Meyering [Sun, 18 Oct 2015 03:12:48 +0000 (20:12 -0700)]
maint.mk: sc_tight_scope: factor and support OS X

* top/maint.mk (_gl_tight_scope): Address three issues:
- factor out four instances of code that wraps a string in "^...$"
- allow nm-reported symbol names to have an optional leading "_"
- add "main" to the list of ignored variable names, because on os x,
"main" has nm-reported type "S" in the variable-checking section.

9 years agoChangeLog: fix typo: s/cound/count/
Jim Meyering [Thu, 24 Sep 2015 16:03:20 +0000 (17:03 +0100)]
ChangeLog: fix typo: s/cound/count/

9 years agosafe-alloc-tests: fix typo in license header
Dmitry Smirnov [Fri, 16 Oct 2015 20:29:41 +0000 (21:29 +0100)]
safe-alloc-tests: fix typo in license header

* tests/test-safe-alloc.c: Mention LGPL 2.1, not 3.1

9 years agocopy-file: fix mem leak in error case
Simon Reinhardt [Thu, 15 Oct 2015 18:35:29 +0000 (19:35 +0100)]
copy-file: fix mem leak in error case

* lib/copy-file.c (qcopy_file_preserving): Free the 32KiB buffer
upon error opening or performing I/O to the src and dest files.

9 years agolocalename: control langinfo.h inclusion
Mike Frysinger [Thu, 15 Oct 2015 08:04:07 +0000 (17:04 +0900)]
localename: control langinfo.h inclusion

This header is only used to work around buggy behavior in old
versions of glibc, so do not include it all the time.  Otherwise
we get build failures on systems that do not provide langinfo.h.

* lib/localename.c: Wrap langinfo.h include with same ifdefs used
in the source later on.
The patch was originally submitted to gettext as:
https://lists.gnu.org/archive/html/bug-gettext/2015-10/msg00011.html

9 years agoupdate from texinfo
Karl Berry [Wed, 14 Oct 2015 22:32:04 +0000 (15:32 -0700)]
update from texinfo

9 years agobinary-io, math, pthread, sys_socket, u64, unistd: port to strict C
Paul Eggert [Wed, 14 Oct 2015 06:25:18 +0000 (23:25 -0700)]
binary-io, math, pthread, sys_socket, u64, unistd: port to strict C

* lib/binary-io.c, lib/math.c, lib/pthread.c, lib/sys_socket.c:
* lib/u64.c, lib/unistd.c:
Append 'typedef int dummy;', to pacify compilers that are picky
about empty translation units.

9 years agoaccept4-tests: fix to avoid non portable flags
Pino Toscano [Mon, 12 Oct 2015 11:27:10 +0000 (12:27 +0100)]
accept4-tests: fix to avoid non portable flags

* tests/test-accept4.c (main): Pass only SOCK_* flags to accept4(),
as they are the only documented ones, and passing others may trigger
EINVAL (seen on FreeBSD 10.1-RELEASE).
* doc/glibc-functions/accept4.texi: Mention that we don't provide
the SOCK_CLOEXEC or SOCK_NONBLOCK defines.

9 years agoupdate from texinfo
Karl Berry [Sat, 10 Oct 2015 15:16:48 +0000 (08:16 -0700)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Tue, 6 Oct 2015 22:06:11 +0000 (15:06 -0700)]
update from texinfo

9 years agognulib-tool: fix tests of 'extensions' module
Pavel Raiskup [Tue, 6 Oct 2015 11:20:05 +0000 (13:20 +0200)]
gnulib-tool: fix tests of 'extensions' module

This complements f8fe25fab60e3c687a124 commit.

* gnulib-tool (func_emit_pre_early_macros): New function, it wraps
emitting of initial gl_EARLY macros.
(func_import, func_create_testdir): All dumps of gl_PROG_AR_RANLIB
replaced with func_emit_pre_early_macros call.

9 years agounicase/locale-language: fix typo in utf-8 cookie
Paul Eggert [Tue, 6 Oct 2015 07:46:02 +0000 (00:46 -0700)]
unicase/locale-language: fix typo in utf-8 cookie

* lib/unicase/locale-languages.gperf: Fix gperf input file format.
Problem reported by Zbigniew Jędrzejewski-Szmek.

9 years agoautoupdate
Karl Berry [Mon, 5 Oct 2015 13:25:17 +0000 (06:25 -0700)]
autoupdate

9 years agoxalloc: do not worry about GCC 5 warning on 32 bit
Paul Eggert [Sat, 3 Oct 2015 07:14:05 +0000 (00:14 -0700)]
xalloc: do not worry about GCC 5 warning on 32 bit

* lib/xalloc.h: Revert previous change.
I found a better way to fix this in coreutils.

9 years agoxalloc: avoid GCC 5.1 warning on 32 bit
Pádraig Brady [Fri, 2 Oct 2015 19:21:50 +0000 (20:21 +0100)]
xalloc: avoid GCC 5.1 warning on 32 bit

* lib/xalloc.h: Disable -Wstrict-overflow for uses of
xalloc_oversized(), which was seen to give this warning
on GCC 5.1 on 32 bit: "assuming signed overflow does not occur
when simplifying conditional".

9 years agouniname/uniname-tests: avoid compiler warnings
Daiki Ueno [Fri, 2 Oct 2015 02:27:40 +0000 (11:27 +0900)]
uniname/uniname-tests: avoid compiler warnings

* tests/uniname/test-uninames.c (fill_names, fill_aliases): Remove
unused local variables.
(test_alias_lookup): Fix alias name display in failure cases.

9 years agoautoupdate
Karl Berry [Sun, 27 Sep 2015 15:55:03 +0000 (08:55 -0700)]
autoupdate

9 years agomountlist: clean up of variable duplication
Andrew Borodin [Sun, 27 Sep 2015 08:41:17 +0000 (11:41 +0300)]
mountlist: clean up of variable duplication

* lib/mountlist.c (read_file_system_list) [MOUNTED_LISTMNTENT]:
the 'me' variable is already declared above.  Remove it here.

9 years agoc-ctype: do not worry about EBCDIC + char signed
Paul Eggert [Sun, 27 Sep 2015 06:55:07 +0000 (23:55 -0700)]
c-ctype: do not worry about EBCDIC + char signed

Drop support for EBCDIC with char being signed, as this breaks too
many programs.  Problem reported by Ben Pfaff in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00053.html
* lib/c-ctype.h: Verify that we are not using EBCDIC with
char being signed.
(_C_CTYPE_LOWER_A_THRU_F_N): New macro.
(_C_CTYPE_LOWER_N, _C_CTYPE_A_THRU_F): Use it.
(_C_CTYPE_DIGIT, _C_CTYPE_LOWER, _C_CTYPE_PUNCT, _C_CTYPE_UPPER):
(c_isascii, c_isgraph, c_isprint, c_ispunct, c_tolower, c_toupper):
* tests/test-c-ctype.c (test_all):
Simplify by assuming standard char values cannot be negative.
* tests/test-c-ctype.c (NCHARS, to_char): Remove; all uses removed.

9 years agoc-ctype: port better to z/OS EBCDIC
Paul Eggert [Sat, 26 Sep 2015 02:45:59 +0000 (19:45 -0700)]
c-ctype: port better to z/OS EBCDIC

Problems reported by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00050.html
* lib/c-ctype.h (_C_CTYPE_CNTRL): Rewrite in terms of
the C standard escapes and _C_CTYPE_OTHER_CNTRL.
(_C_CTYPE_OTHER_CNTRL): New macro.
* tests/test-c-ctype.c (test_all): Test from CHAR_MIN, not
from SCHAR_MIN, as the functions are defined only from values
promoted from char or from unsigned char, not necessarily from
signed char.

9 years agognulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup [Fri, 25 Sep 2015 18:25:03 +0000 (11:25 -0700)]
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash

The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR
and ARFLAGS variables.  Doing this unconditionally could break
later Automake's AM_PROG_AR invocation (at least it's
AC_CHECK_TOOLS call to detect correct 'ar' binary).

Original purpose of the gl_PROG_AR_RANLIB was only to handle the
Amsterdam Compiler Kit, so make the previous code to have effects
only on ACK, and rather automatically call the Automake's
AM_PROG_AR as soon as possible to decide other cases.

References:
http://lists.gnu.org/archive/html/bug-gnulib/2015-07/msg00001.html

* m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR.
Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR.  If neither
is possible, keep setting AR/ARFLAGS to reasonable defaults.
* gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS
right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the
'extensions' module is used.
* modules/extensions (configure.ac-early): Remove as this snippet
is added to gnulib-comp.m4 earlier anyway.

9 years agosockets: MS Windows initalization fixes
Paul Eggert [Fri, 25 Sep 2015 18:16:27 +0000 (11:16 -0700)]
sockets: MS Windows initalization fixes

Problem reported by Test User in:
http://lists.gnu.org/archive/html/help-shishi/2015-09/msg00001.html
* lib/sockets.h (SOCKETS_1_0, SOCKETS_2_0, SOCKETS_2_1):
Correct the endianness.
* lib/sockets.c (gl_sockets_startup): Return 2 on any version
number mismatch, not just on <.  Cleanup before any such failure.

9 years agogc: fix detection of installed libgcrypt version
Mats Erik Andersson [Fri, 25 Sep 2015 12:18:24 +0000 (14:18 +0200)]
gc: fix detection of installed libgcrypt version

* m4/gc.m4: Use AM_PATH_LIBCRYPT to test for libcrypt versions
at least as recent as 1.4.4.  The previously used macro is not
available now, since modules were removed in version 1.6.0.

9 years agoc-ctype: rewrite to use inline functions
Paul Eggert [Fri, 25 Sep 2015 07:01:10 +0000 (00:01 -0700)]
c-ctype: rewrite to use inline functions

This simplifies maintenance, since it makes for just one
implementation of each function, letting the compiler have the fun
of optimization.  In practice this works well nowadays with GCC.
E.g., c_isascii might need only three instructions even though the
source code lists every ASCII character individually in a large
switch statement.
Also, fix some z/OS porting bugs reported by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00037.html
* NEWS: Document the API change.
* lib/c-ctype.c: Drastically simplify, since this now just expands
inline functions.
* lib/c-ctype.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(C_CTYPE_INLINE): New macro.
(C_CTYPE_CONSECUTIVE_DIGITS, C_CTYPE_CONSECUTIVE_LOWERCASE)
(C_CTYPE_CONSECUTIVE_UPPERCASE): Remove.
Verify that either ASCII or EBCDIC is being used.
(_C_CTYPE_SIGNED_EBCDIC, _C_CTYPE_CNTRL, _C_CTYPE_A_THRU_F_N)
(_C_CTYPE_DIGIT_N, _C_CTYPE_LOWER_N, _C_CTYPE_UPPER_N)
(_C_CTYPE_CASES, _C_CTYPE_A_THRU_F, _C_CTYPE_DIGIT, _C_CTYPE_LOWER)
(_C_CTYPE_UPPER, _C_CTYPE_PUNCT_PLAIN):
New private macros.
(_C_CTYPE_CNTRL): In EBCDIC, '\x07' is a control, not '\xff'.
(c_isalnum, c_isalpha, c_isascii, c_isblank, c_iscntrl, c_isdigit)
(c_isgraph, c_islower, c_isprint, c_ispunct, c_isspace, c_isupper)
(c_isxdigit, c_tolower, c_toupper): Now inline functions.
(c_tolower, c_toupper): When converting, return the unsigned char,
as that is what z/OS does.
* lib/c-strcaseeq.h (CASEEQ): Simplify in the light of the removal
of some c-ctype.h macros.
* modules/c-ctype (Depends-on): Add extern-inline; remove verify.
* tests/test-c-ctype.c (test_all): Fix test for c_toupper and
c_tolower promotion to be compatible with z/OS.

9 years agofnmatch: add one more coding cookie
Paul Eggert [Thu, 24 Sep 2015 20:49:38 +0000 (13:49 -0700)]
fnmatch: add one more coding cookie

9 years agomaint: add coding cookies to non-ASCII sources
Paul Eggert [Thu, 24 Sep 2015 20:22:23 +0000 (13:22 -0700)]
maint: add coding cookies to non-ASCII sources

Otherwise, Emacs might do the wrong thing if run in an
he_IL.ISO-8859-8 locale, which an Emacs developer does on occasion.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00966.html

Don't bother with test files, as they aren't copied to the Emacs
source directory.  If this problem affects test files in some other
GNU project, we can add coding cookies to the non-ASCII test files
later.

9 years agogitlog-to-changelog: trim only trailing whitespaces
Pavel Raiskup [Thu, 24 Sep 2015 15:17:38 +0000 (17:17 +0200)]
gitlog-to-changelog: trim only trailing whitespaces

This is fix for --format regression introduced by commit
2b93079a5d1baa4d;  it caused that --format='%s%n%n%b%n' (see the
doubled %n string) had no effect anymore.  This format
specification has been used e.g. by GNU paxuitils (commit
edfd8bcc3).

* build-aux/gitlog-to-changelog (main): Stop squashing multiple
newlines in commmit messages.

9 years agoTest that c_iscntrl agrees with iscntrl, etc.
Paul Eggert [Wed, 23 Sep 2015 19:26:38 +0000 (12:26 -0700)]
Test that c_iscntrl agrees with iscntrl, etc.

Suggested by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00034.html
* modules/c-ctype-tests (Depends-on): Add ctype.
* tests/test-c-ctype.c: Include <ctype.h>.
(NCHARS): New constant.
(test_agree_with_C_locale): New function.
(main): Use it.
(test_all): Use named constants.

9 years agoc-ctype: improve c_isascii testing
Paul Eggert [Wed, 23 Sep 2015 19:02:35 +0000 (12:02 -0700)]
c-ctype: improve c_isascii testing

* tests/test-c-ctype.c (test_all): Port c_isascii test to EBCDIC.
Add a test to count the number of ASCII characters.

9 years agoFix ChangeLog typo
Paul Eggert [Wed, 23 Sep 2015 15:11:16 +0000 (08:11 -0700)]
Fix ChangeLog typo

9 years agosavewd: remove SAVEWD_CHDIR_READABLE
Paul Eggert [Wed, 23 Sep 2015 03:04:13 +0000 (20:04 -0700)]
savewd: remove SAVEWD_CHDIR_READABLE

It was problematic in the light of file systems that ignore umask.
Problem reported by Sebastian Ungar in: http://bugs.gnu.org/21534
* NEWS: Document this.
* lib/mkancesdirs.c (mkancesdirs): MAKE_DIR now returns 0 if
successful, -1 (setting errno) on failure, rather than something
more complicated than that.
* lib/mkdir-p.c (make_dir_parents):
Do not use SAVEWD_CHDIR_READABLE.
* lib/savewd.c (savewd_chdir):
Remove support for SAVEWD_CHDIR_READABLE.
* lib/savewd.h (SAVEWD_CHDIR_READABLE): Remove.

9 years agoUpdate ChangeLog to match previous patch.
Paul Eggert [Wed, 23 Sep 2015 02:41:52 +0000 (19:41 -0700)]
Update ChangeLog to match previous patch.

9 years agoc-ctype: support EBCDIC-style c_isascii
Paul Eggert [Wed, 23 Sep 2015 01:59:28 +0000 (18:59 -0700)]
c-ctype: support EBCDIC-style c_isascii

* lib/c-ctype.c (C_TYPE_EBCDIC): Move to top level.
(c_isascii, c_iscntrl): Assume EBCDIC code page 1047 for control
characters, if EBCDIC.

9 years agoc-ctype: assume EBCDIC 1047 for c_iscntrl
Paul Eggert [Tue, 22 Sep 2015 21:47:06 +0000 (14:47 -0700)]
c-ctype: assume EBCDIC 1047 for c_iscntrl

* lib/c-ctype.c (c_iscntrl): When EBCDIC, assume code page 1047 at
both compile-time and at run-time.  Check it at compile-time.  We can
worry about other code pages later, if the topic ever comes up.
Fix typo in C_CTYPE_EBCDIC.

9 years ago* modules/c-ctype (Depends-on): Add verify.
Paul Eggert [Tue, 22 Sep 2015 19:44:25 +0000 (12:44 -0700)]
* modules/c-ctype (Depends-on): Add verify.

9 years agoc-ctype: port better to EBCDIC
Paul Eggert [Tue, 22 Sep 2015 19:17:06 +0000 (12:17 -0700)]
c-ctype: port better to EBCDIC

Problems reported by Daniel Richard G. in
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00020.html
* lib/c-ctype.c: Include <limits.h>, for CHAR_MIN and CHAR_MAX.
Include "verify.h".
(C_CTYPE_ASCII, C_CTYPE_CONSECUTIVE_DIGITS)
(C_CTYPE_CONSECUTIVE_LOWERCASE, C_CTYPE_CONSECUTIVE_UPPERCASE):
Define as enum constants with value false, if not defined, so that
code can use 'if' instead of 'ifdef'.  Using 'if' helps make the
code more portable, as both branches of the 'if' are compiled on
all platforms.
(C_CTYPE_EBCDIC): New constant.
(to_char): New static function.
(c_isalnum, c_isalpha, c_isdigit, c_islower, c_isgraph, c_isprint)
(c_ispunct, c_isupper, c_isxdigit, c_tolower, c_toupper):
Rewrite to use 'if' instead of 'ifdef'.
Use to_char if non-ASCII.  Prefer <= to >=.
Prefer true and false to 1 and 0, for booleans.
(c_iscntrl): Use 'if', not 'ifdef'.  Special case for EBCDIC.
Verify that the character set is either ASCII or EBCDIC.
* tests/test-c-ctype.c: Include <limits.h>, for CHAR_MIN
(to_char): New function.
(test_all): Port to EBCDIC.  Add some more tests, e.g., for c_ispunct.

9 years agonanosleep: fix return code for interrupted replacement
Pádraig Brady [Mon, 21 Sep 2015 22:46:05 +0000 (23:46 +0100)]
nanosleep: fix return code for interrupted replacement

* lib/nanosleep.c (nanosleep): In the replaced nanosleep, ensure
that we return -1 in the case the call is interrupted by a signal,
rather than the current value of 1.
Diagnosed and tested by Daniel Richard G.

9 years agoautoupdate
Karl Berry [Sun, 20 Sep 2015 22:24:53 +0000 (15:24 -0700)]
autoupdate

9 years agoDiagnose ERE '()|\1'
Paul Eggert [Sat, 19 Sep 2015 20:53:34 +0000 (13:53 -0700)]
Diagnose ERE '()|\1'

Problem reported by Hanno Böck in: http://bugs.gnu.org/21513
* lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep
track of the set of previously-completed subexpressions available
before the first alternative, and restore this set just before
parsing each subsequent alternative.  This lets us diagnose the
invalid back-reference in the ERE '()|\1'.

9 years agoRevert previous patch, as it did not fix the bug after all.
Paul Eggert [Sat, 19 Sep 2015 20:44:49 +0000 (13:44 -0700)]
Revert previous patch, as it did not fix the bug after all.

9 years agoregex: fix dangling-backreference bug
Paul Eggert [Sat, 19 Sep 2015 17:16:02 +0000 (10:16 -0700)]
regex: fix dangling-backreference bug

This should fix the following bugs:
http://bugs.gnu.org/21513 assertion error in pop_fail_stack
http://bugs.gnu.org/19775 Test failing after the CVE fix
https://sourceware.org/bugzilla/show_bug.cgi?id=11053
Wrong results with backreferences
https://sourceware.org/bugzilla/show_bug.cgi?id=17356
regex assertion violation with triple backreferences
* lib/regexec.c (set_regs): Don't pop an empty failure stack.

9 years agoregex: merge patches from libc
Paul Eggert [Sat, 19 Sep 2015 16:21:47 +0000 (09:21 -0700)]
regex: merge patches from libc

2015-09-08  Joseph Myers  <joseph@codesourcery.com>
Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912).
* lib/regex_internal.h:
Include <libc-lock.h> instead of <bits/libc-lock.h>.

2015-06-09  Joseph Myers  <joseph@codesourcery.com>
Fix regcomp wcscoll, wcscmp namespace (bug 18497).
* lib/regcomp.c (build_range_exp): Call __wcscoll instead of
wcscoll.
* lib/regexec.c (check_node_accept_bytes): Likewise.

2015-06-05  Joseph Myers  <joseph@codesourcery.com>
Fix regex wcrtomb namespace (bug 18496).
* lib/regex_internal.c (build_wcs_upper_buffer): Call __wcrtomb
instead of wcrtomb.

2015-06-05  Joseph Myers  <joseph@codesourcery.com>
Fix regex wctype namespace (bug 18495).
* lib/regcomp.c (re_compile_fastmap_iter): Call __towlower
instead of towlower.
* lib/regex_internal.c (build_wcs_upper_buffer): Call __iswlower
instead of iswlower.  Call __towupper instead of towupper.
* lib/regex_internal.h (IS_WIDE_WORD_CHAR): Call __iswalnum
instead of iswalnum.

2015-01-07  Chris Metcalf  <cmetcalf@ezchip.com>
* lib/regcomp.c (parse_bracket_exp): Initialize type to
COLL_SYM in a couple of places to avoid uninitialized variable
wanings on tilegx gcc 4.8.2.

2014-11-24  Siddhesh Poyarekar  <siddhesh@redhat.com>
* lib/regex_internal.h: Remove NOT_IN_libc.

2014-11-17  Andreas Schwab  <schwab@suse.de>
* lib/regex_internal.h: Don't include <locale/elem-hash.h>.

2014-09-11  Roland McGrath  <roland@hack.frob.com>
Move findidx nested functions to top-level.
* lib/regcomp.c [_LIBC]: #include <locale/weight.h>.
(build_equiv_class) [_LIBC]: Don't #include it inside the function.
Pass new arguments to findidx.
* lib/regexec.c [RE_ENABLE_I18N] [_LIBC]: #include <locale/weight.h>.
[RE_ENABLE_I18N] (check_node_accept_bytes) [_LIBC]:
Don't #include it inside the function.  Pass new arguments to findidx.
* lib/regex_internal.h:
[!NOT_IN_libc] [_LIBC]: #include <locale/weight.h>.
(re_string_elem_size_at): Don't #include it inside the function.
Pass new arguments to findidx.

2014-08-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
Check if DEBUG is defined in regex_internal.c
* lib/regex_internal.c: Check if DEBUG is defined and is set.

9 years agoautoupdate
Karl Berry [Tue, 15 Sep 2015 16:11:15 +0000 (09:11 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Mon, 14 Sep 2015 20:08:27 +0000 (13:08 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Sun, 13 Sep 2015 16:48:04 +0000 (09:48 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Fri, 11 Sep 2015 15:45:35 +0000 (08:45 -0700)]
autoupdate

9 years agoceill: detect buggy OpenBSD implementation
Assaf Gordon [Tue, 8 Sep 2015 23:43:32 +0000 (19:43 -0400)]
ceill: detect buggy OpenBSD implementation

* m4/ceill.m4 (gl_FUNC_CEILL): Detect buggy openBSD implementation
which returns zero for small values.  Discussed here:
http://lists.gnu.org/archive/html/bug-gnulib/2015-08/msg00010.html

9 years agomountlist: add me_mntroot field on Linux machines
Dave Chiluk [Mon, 31 Aug 2015 21:07:58 +0000 (16:07 -0500)]
mountlist: add me_mntroot field on Linux machines

* lib/mountlist.c (read_file_system_list): Populate me_mntroot in
mount_entry so Linux machines based on /proc/self/mountinfo can
distinguish between bind mounts and original mounts.  In reality bind
mounts aren't treated differently than mountroot=/ mounts by the
kernel, but the user often wants these bind mounts distinguished.
* lib/mountlist.h (struct mount_entry): Add me_mntroot element.
More details at https://pad.lv/1432871

9 years agodoc: Describe to use multiple instances of gnulib
Christian Egli [Fri, 4 Sep 2015 10:06:46 +0000 (12:06 +0200)]
doc: Describe to use multiple instances of gnulib

* doc/gnulib-tool.texi: Add a section to the manual outlining how two
instances of gnulib with different modules can be used, for example one
for a lib and another one for associated tools.

9 years agoautoupdate
Karl Berry [Sat, 5 Sep 2015 17:46:36 +0000 (10:46 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Wed, 2 Sep 2015 13:47:57 +0000 (06:47 -0700)]
autoupdate

9 years agobase32: mark function as __attribute__ const
Pádraig Brady [Tue, 1 Sep 2015 10:59:35 +0000 (11:59 +0100)]
base32: mark function as __attribute__ const

* lib/base32.h (isbase32): Mark __attribute__ const as
suggested by GCC, and consistent with the base64 module.

9 years agoautoupdate
Karl Berry [Sun, 30 Aug 2015 12:57:45 +0000 (05:57 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Wed, 26 Aug 2015 13:29:21 +0000 (06:29 -0700)]
autoupdate

9 years agognulib-tool: don't transform binary files with sed
Daiki Ueno [Thu, 20 Aug 2015 00:09:58 +0000 (09:09 +0900)]
gnulib-tool: don't transform binary files with sed

* gnulib-tool (func_add_or_update): Don't apply sed_transform_* to
.mo and .class files.
Reported by Denis Denisov.

9 years agoautoupdate
Karl Berry [Mon, 24 Aug 2015 13:09:19 +0000 (06:09 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Sat, 22 Aug 2015 14:52:01 +0000 (07:52 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Thu, 20 Aug 2015 13:35:49 +0000 (06:35 -0700)]
autoupdate

9 years agoautoupdate
Karl Berry [Tue, 18 Aug 2015 18:00:32 +0000 (11:00 -0700)]
autoupdate

9 years agogperf: respect silent rules
Daiki Ueno [Mon, 10 Aug 2015 15:22:15 +0000 (17:22 +0200)]
gperf: respect silent rules

* modules/gperf (Makefile.am): Define V_GPERF, V_GPERF_, and
V_GPERF_0 for silent rules.
* modules/iconv_open (Makefile.am): Use V_GPERF.
* modules/unicase/locale-language (Makefile.am): Likewise.
* modules/unicase/special-casing (Makefile.am): Likewise.
* modules/unictype/category-byname (Makefile.am): Likewise.
* modules/unictype/combining-class-byname (Makefile.am): Likewise.
* modules/unictype/joininggroup-byname (Makefile.am): Likewise.
* modules/unictype/joiningtype-byname (Makefile.am): Likewise.
* modules/unictype/property-byname (Makefile.am): Likewise.
* modules/unictype/scripts (Makefile.am): Likewise.
* modules/uninorm/composition (Makefile.am): Likewise.

9 years agoImprove port of stdalign to C++11
Paul Eggert [Mon, 3 Aug 2015 19:34:38 +0000 (12:34 -0700)]
Improve port of stdalign to C++11

Problem reported by Sundaram in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-08/msg00003.html
* lib/stdalign.in.h (alignof, alignas): Don't define if C++11 or newer.
(__alignas_is_defined): Define if C++11 or newer.

9 years agopmccabe2html: fix gawk regex escaping
Assaf Gordon [Sun, 2 Aug 2015 05:30:07 +0000 (23:30 -0600)]
pmccabe2html: fix gawk regex escaping

* build-aux/pmccabe2html: Add one more backslash to properly
escape the gsub replacement value.  Fixes this error:
gawk: ./build-aux/pmccabe2html:425: \
warning: escape sequence `\&' treated as plain `&'

9 years agoupdate from texinfo
Karl Berry [Sat, 1 Aug 2015 21:41:21 +0000 (14:41 -0700)]
update from texinfo

9 years agotime_rz: port to pedantic memcpy
Paul Eggert [Wed, 29 Jul 2015 20:48:10 +0000 (13:48 -0700)]
time_rz: port to pedantic memcpy

* lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations
that reject memcpy (..., NULL, 0).

9 years agoautoupdate
Karl Berry [Tue, 28 Jul 2015 20:57:32 +0000 (13:57 -0700)]
autoupdate

9 years agotime_rz: port better to MinGW
Paul Eggert [Mon, 27 Jul 2015 23:41:17 +0000 (16:41 -0700)]
time_rz: port better to MinGW

Don't change tzname, as this makes MinGW dump core (Bug#21020).
Instead, store the tzname copy in the struct tm_zone object.
Problem reported by Eli Zaretskii in: http://bugs.gnu.org/21020#48
* lib/strftime.c [!_LIBC]:
* lib/time_rz.c: Include time-internal.h.
* lib/strftime.c (strftime_case_) [!HAVE_TM_ZONE]: Infer the zone
name from *TZ rather than from TZNAME, doable because *TZ now has
a tzname_copy member.
* lib/time-internal.h: New file, with contents taken from
lib/time_rz.c.  It's separate because strftime.c now accesses
struct tm_zone members.
(struct tm_zone) [HAVE_TZNAME && !HAVE_TM_ZONE]:
New member tzname_copy.
* lib/time_rz.c (struct tm_zone): Move to time-internal.h.
(tzalloc) [HAVE_TZNAME && !HAVE_TM_ZONE]:
Initialize tzname_copy member.
(save_abbr) [HAVE_TZNAME && !HAVE_TM_ZONE]: Save abbreviation
in tzname_copy member.
(revert_tz) [HAVE_TZNAME]: Remove no-longer-needed tzname saving.
(restore_tzname): Remove; no longer needed.  All calls removed.
* modules/time_rz (Files): Add lib/time-internal.h.

9 years agotime: port __need_time_t to MinGW
Paul Eggert [Mon, 27 Jul 2015 14:53:36 +0000 (07:53 -0700)]
time: port __need_time_t to MinGW

* lib/time.in.h (__need_time_t): Do not treat specially on MinGW.
Fix reported by Eli Zaretskii in: http://bugs.gnu.org/21020#36

9 years agostrftime: fix newly-introduced bug on Solaris
Paul Eggert [Sat, 25 Jul 2015 23:37:17 +0000 (16:37 -0700)]
strftime: fix newly-introduced bug on Solaris

* lib/strftime.c (strftime_case_): Set the local variable 'zone'
consistently at the start, rather than doing some of the setup at
the start and some in the %Z format spec.  This is cleaner, and
works better with time_rz on platforms like Solaris where struct
tm lacks a tm_zone member, as when !HAVE_TM_GMTOFF %z's calls to
mktime_z and localtime_rz can mess up the tzname cache.

9 years agotest-strftime: test for Solaris bug
Paul Eggert [Sat, 25 Jul 2015 22:20:57 +0000 (15:20 -0700)]
test-strftime: test for Solaris bug

* modules/strftime-tests (Depends-on): Add strerror.
* tests/test-strftime.c: Include <errno.h>.
(posixtm_test): New function, containing the old 'main'.
(struct tzalloc_test, struct localtime_rz_test): New types.
(TZ, LT): New static vars.
(tzalloc_test): New function.
(main): Rewrite in terms of posixtm_test and tzalloc_test.

9 years agotime_rz: port to Solaris etc.
Paul Eggert [Sat, 25 Jul 2015 22:20:10 +0000 (15:20 -0700)]
time_rz: port to Solaris etc.

Works around a tzname problem on platforms like Solaris that have
tzname but not tm_zone, by setting tzname at the appropriate time
and restoring it later.
* lib/time_rz.c (tzname_address, tzname_value) [HAVE_TZNAME]:
New static vars.
(save_abbr) [HAVE_TZNAME]: Set them.
(revert_tz) [HAVE_TZNAME]: Clear or use them.
(restore_tzname): New function.
(localtime_rz, mktime_z): Use it.

9 years agotime_rz: now LGPL
Paul Eggert [Sat, 25 Jul 2015 22:13:13 +0000 (15:13 -0700)]
time_rz: now LGPL

* modules/time_rz (License): Now LGPL, because strftime depends on it.

9 years agotime_rz: make a constant 'const'
Paul Eggert [Sat, 25 Jul 2015 22:11:42 +0000 (15:11 -0700)]
time_rz: make a constant 'const'

* lib/time_rz.c (local_tz): Now const.