gnulib.git
10 years agomgetgroups: remove dependency on realloc-gnu
Paul Eggert [Mon, 14 Oct 2013 06:08:42 +0000 (23:08 -0700)]
mgetgroups: remove dependency on realloc-gnu

The dependency violates the comment in realloc-gnu, which
says that tests can't depend on realloc-gnu; some tests depend
on mgetgroups, so mgetgroups can't depend on realloc-gnu.
Problem reported by Daniel Richard G. in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00056.html>.
* lib/mgetgroups.c (mgetgroups): Don't call realloc (NULL, 0).
* modules/mgetgroups (Depends-on): Depend on realloc-posix,
not realloc-gnu.

10 years agoregex-tests: port to HP-UX 11.11
Paul Eggert [Sat, 12 Oct 2013 18:50:15 +0000 (11:50 -0700)]
regex-tests: port to HP-UX 11.11

Problem reported by Daniel Richard G. in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00052.html>.
* modules/regex-tests (test_regex_LDADD): Add LIBTHREAD, LIB_PTHREAD.

10 years agoverify: document some 'assume' pitfalls
Paul Eggert [Fri, 11 Oct 2013 04:30:16 +0000 (21:30 -0700)]
verify: document some 'assume' pitfalls

* doc/verify.texi (Compile-time Assertions):
Mention that 'assume (E)' can sometimes slow things down.
Use CHAR_MAX + 1, not UCHAR_MAX + 1.

10 years agostrtoumax: fix another typo in previous commit
Eric Blake [Thu, 10 Oct 2013 19:34:46 +0000 (13:34 -0600)]
strtoumax: fix another typo in previous commit

I missed one in the last commit...

* modules/strtoumax (configure.ac): Fix typo.
* modules/strtoimax (configure.ac): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agostrtoumax: fix typo in previous commit.
Eric Blake [Thu, 10 Oct 2013 18:24:59 +0000 (12:24 -0600)]
strtoumax: fix typo in previous commit.

Tom G. Christensen reported:

> I see this in the configure output:
> ./configure: line 7680: test: =: unary operator expected
>
> $ sed -n 7680p configure
>   if test $HAVE_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then

and indeed, we're only setting HAVE_DECL_STRTOUMAX.

* modules/strtoumax (Depends-on): Fix typo.
* modules/strtoimax (Depends-on): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agostrtoumax: port to Solaris 8
Paul Eggert [Thu, 10 Oct 2013 16:15:18 +0000 (09:15 -0700)]
strtoumax: port to Solaris 8

This problem was introduced in the recent HP-UX patch.
Reported by Tom G. Christensen in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00037.html>.
* modules/strtoumax (Depends-on): Test HAVE_STRTOUMAX
and REPLACE_STRTOUMAX rather than ac_cv_func_strtoumax.

10 years agoautoupdate
Karl Berry [Thu, 10 Oct 2013 16:13:26 +0000 (09:13 -0700)]
autoupdate

10 years agostrtoimax, strtoumax: port to HP-UX 11.11
Paul Eggert [Wed, 9 Oct 2013 15:05:24 +0000 (08:05 -0700)]
strtoimax, strtoumax: port to HP-UX 11.11

Problem reported by Daniel Richard G. in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00023.html>.
* lib/inttypes.in.h (strtoumax): Replace strtoumax if
REPLACE_STRTOUMAX, thus treating it consistently with strtoimax.
* m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Add default for
REPLACE_STRTOUMAX.
* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX):
* m4/strtoumax.m4 (gl_FUNC_STRTOUMAX):
Replace the function if defined as a macro but not as a function.
* modules/inttypes-incomplete (inttypes.h): Substitute
REPLACE_STRTOUMAX.
* modules/strtoumax (configure.ac): Replace strtoumax if
REPLACE_STRTOUMAX.

10 years agostrtoimax: port to HP-UX 11.11
Paul Eggert [Wed, 9 Oct 2013 06:27:49 +0000 (23:27 -0700)]
strtoimax: port to HP-UX 11.11

Problem reported by Daniel Richard G.
* lib/strtoimax.c (Strtoimax, Strtol, Strtoll): New macros.
(strtoimax, strtol, strtoll) [UNSIGNED]: Remove, since
they might clash with inttypes.h.

10 years agoNew module 'count-trailing-zeros'.
Paul Eggert [Mon, 7 Oct 2013 06:58:00 +0000 (23:58 -0700)]
New module 'count-trailing-zeros'.

* MODULES.html.sh: Mention it.
* lib/count-trailing-zeros.c, lib/count-trailing-zeros.h:
* m4/count-trailing-zeros.m4, modules/count-trailing-zeros:
* modules/count-trailing-zeros-tests:
* tests/test-count-trailing-zeros.c:
New files.

10 years agocount-leading-zeros: port to MSC; support types wider than 64 bits
Paul Eggert [Mon, 7 Oct 2013 06:51:44 +0000 (23:51 -0700)]
count-leading-zeros: port to MSC; support types wider than 64 bits

The ideas behind the MSC port are stolen from Emacs.
* lib/count-leading-zeros.h:
Don't include verify.h: it's no longer needed, as types wider than
64 bits are now supported.
(COUNT_LEADING_ZEROS): New arg MSC_BUILTIN, for better
performance with MSC.  All uses changed.  Do not assume that TYPE
has at most 64 bits.
(count_leading_zeros_32): Assume 0 < X < 2**32, for speed.
All uses changed.  Fold the subtraction from 31 into the table.

10 years agocount-one-bits: port to MSC; support types wider than 64 bits
Paul Eggert [Mon, 7 Oct 2013 06:43:43 +0000 (23:43 -0700)]
count-one-bits: port to MSC; support types wider than 64 bits

The ideas behind the MSC port are stolen from Emacs.
* lib/count-one-bits.c (popcount_support) [_MSC_VER]: New variable.
* lib/count-one-bits.h: Include limits.h, for CHAR_BIT.
Don't include verify.h: it's no longer needed, as types wider than
64 bits are now supported.
(COUNT_ONE_BITS_GENERIC): New macro.
(popcount_supported) [_MSC_VER]: New inline function.
(COUNT_ONE_BITS): Use it.  New arg MSC_BUILTIN, for better
performance with MSC.  All uses changed.  Do not assume that TYPE
has at most 64 bits.
* modules/count-one-bits (Depends-on): Do not depend on 'verify'.

10 years agomountlist: fix resource leak with MOUNTED_INTERIX_STATVFS
Andrew Borodin [Sun, 6 Oct 2013 14:28:17 +0000 (18:28 +0400)]
mountlist: fix resource leak with MOUNTED_INTERIX_STATVFS

* lib/mountlist.c (read_file_system_list): fix leak of directory
streams in case of #ifdef MOUNTED_INTERIX_STATVFS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
10 years agotests: improve diagnostic when an assertion fails
Paul Eggert [Sun, 6 Oct 2013 21:10:29 +0000 (14:10 -0700)]
tests: improve diagnostic when an assertion fails

* tests/macros.h (ASSERT): Report the assertion that failed.

10 years agoverify: new macro 'assume'
Paul Eggert [Thu, 3 Oct 2013 04:59:38 +0000 (21:59 -0700)]
verify: new macro 'assume'

This is taken from Emacs, and should be generally useful.
* doc/verify.texi (assume): Document it.
* lib/verify.h (assume): New macro.
(__has_builtin): Expand to 0 if not defined.

10 years agoautoupdate
Karl Berry [Tue, 1 Oct 2013 14:14:32 +0000 (07:14 -0700)]
autoupdate

10 years agodup2, dup3: work around another cygwin crasher
Eric Blake [Thu, 26 Sep 2013 13:07:07 +0000 (07:07 -0600)]
dup2, dup3: work around another cygwin crasher

Cygwin 1.7.25 can crash due to an off-by-one bug on an attempt to
duplicate a file into the current RLIMIT_NOFILE soft limit, when
that limit is smaller than the hard limit.  The intent in the
cygwin code was to allow the dup and auto-increase the soft limit,
which is itself questionable (and which we work around in the
gnulib getdtablesize module); but avoiding the crash is worth
doing even if the soft limit semantics are wrong.

http://cygwin.com/ml/cygwin/2013-09/msg00397.html
http://cygwin.com/ml/cygwin-developers/2013-q3/msg00010.html

* m4/dup2.m4 (gl_FUNC_DUP2): Expose the bug.
* m4/dup3.m4 (gl_FUNC_DUP3): Likewise.
* tests/test-dup2.c (main): Likewise.
* lib/dup2.c (rpl_dup2): Use setdtablesize to avoid it.
* lib/dup3.c (dup3): Likewise.
* doc/posix-functions/dup2.texi (dup2): Document it.
* doc/glibc-functions/dup3.texi (dup3): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agogetdtablesize: work around cygwin issue
Eric Blake [Thu, 26 Sep 2013 17:26:29 +0000 (11:26 -0600)]
getdtablesize: work around cygwin issue

Cygwin 1.7.25 has a bug that even though it claims to support
RLIMIT_NOFILE inheritance, there is no enforcement of the soft
limit, and getdtablesize() automatically grows until it reaches
the hard limit which cannot be changed by setrlimit().  Best is
to just treat things as an invariant limit, as several other
modules assume that getdtablesize() will not change without an
intervening setrlimit().

* m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem.
* modules/getdtablesize (configure.ac): Build replacement.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness.
* modules/unistd (Makefile.am): Expose the witness.
* lib/unistd.in.h (getdtablesize): Declare replacement.
* lib/getdtablesize.c (rpl_getdtablesize): Work around it.
* tests/test-getdtablesize.c (main): Test it.
* doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agopmccabe2html: escaping of special characters
Mats Erik Andersson [Wed, 25 Sep 2013 20:27:03 +0000 (22:27 +0200)]
pmccabe2html: escaping of special characters

The C code characters '<', '>', and '&' were improperly
escaped in HTML output, and their multiplicity was ignored.

10 years agomanywarnings: enable nicer gcc warning messages
Eric Blake [Tue, 24 Sep 2013 12:33:40 +0000 (06:33 -0600)]
manywarnings: enable nicer gcc warning messages

With gcc 4.3.4, -Wdisabled-optimization is noisy unless you also
use -funit-at-a-time.

With gcc 4.4.7, there is no indication which warning option
triggered a particular message unless you also use
-fdiagnostics-show-option.

Both of these options are default in newer gcc (such as 4.8.1);
but including them in the list of possible warnings makes the
experience nicer on older platforms.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Older gcc requires
some -f options for optimal warnings.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotimespec: use the new TIMESPEC_RESOLUTION in a few more places
Jim Meyering [Sat, 21 Sep 2013 16:11:49 +0000 (09:11 -0700)]
timespec: use the new TIMESPEC_RESOLUTION in a few more places

* lib/timespec-add.c (timespec_add): Also replace 999999999
with TIMESPEC_RESOLUTION - 1.
* lib/timespec-sub.c (timespec_sub): Likewise.

10 years agowarnings: port --enable-gcc-warnings to Solaris Studio 12.3
Paul Eggert [Mon, 23 Sep 2013 17:16:13 +0000 (10:16 -0700)]
warnings: port --enable-gcc-warnings to Solaris Studio 12.3

Problem reported by Dagobert Michelsen via Eric Blake in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00052.html>.
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use AC_LINK_IFELSE,
not AC_COMPILE_IFELSE.

10 years agoconfigmake: support new --runstatedir option
Eric Blake [Thu, 12 Sep 2013 22:23:31 +0000 (16:23 -0600)]
configmake: support new --runstatedir option

http://lwn.net/Articles/436012/ documents that many distros
are now preferring to use /run rather than /var/run for
storage of pid files and other per-process temporary files
that must not be cleaned out during arbitrary TMPDIR sweeps.
As such, the GNU Coding Standards were recently changed to
recommend a new configure option to make it easy to choose
this directory at configure time, and autoconf 2.70 will
support the new directory by default.  This patch adds support
for propagating results of the new option (for new enough
autotools) or providing a sane default (for older autotools)
into C code.

* m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
even if autoconf was too old to provide the command line option.
* modules/configmake (Makefile.am): Propagate it to .h file.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoctype, string: depend on extern-inline
Paul Eggert [Mon, 23 Sep 2013 04:25:25 +0000 (21:25 -0700)]
ctype, string: depend on extern-inline

This is needed to complete the recent OS X fixes.
Also, fix related documentation as suggested by Eric Blake.
* doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
* doc/posix-functions/isascii.texi, doc/posix-functions/iscntrl.texi:
* doc/posix-functions/isdigit.texi, doc/posix-functions/isgraph.texi:
* doc/posix-functions/islower.texi, doc/posix-functions/isprint.texi:
* doc/posix-functions/ispunct.texi, doc/posix-functions/isspace.texi:
* doc/posix-functions/isupper.texi, doc/posix-functions/isxdigit.texi:
* doc/posix-functions/toascii.texi, doc/posix-functions/tolower.texi:
* doc/posix-functions/toupper.texi:
List the 'ctype' gnulib module.
* doc/posix-functions/strcat.texi, doc/posix-functions/strcpy.texi:
* doc/posix-functions/strncpy.texi:
List the 'string' gnulib module.
* modules/memcpy, modules/memmove, modules/memset (Depends-on):
Add string.
* modules/ctype, modules/string (Depends-on): Add extern-inline.

10 years agouserspec: support optional parameters to parse_user_spec()
Pádraig Brady [Fri, 20 Sep 2013 02:51:27 +0000 (03:51 +0100)]
userspec: support optional parameters to parse_user_spec()

* lib/userspec.c (parse_user_spec): If the GID param is NULL,
then avoid group processing and treat the full spec as a user.
(parse_with_separator): Allow the USERNAME and GROUPNAME to
be optional params (NULL), in which case they're ignored.
* tests/test-userspec.c (main): Ensure NULL params are ignored.

10 years agotimespec: new function make_timespec, and new constants
Paul Eggert [Thu, 19 Sep 2013 21:12:29 +0000 (14:12 -0700)]
timespec: new function make_timespec, and new constants

* lib/timespec.h: Incorporate recent changes on the Emacs trunk.
(TIMESPEC_RESOLUTION, LOG10_TIMESPEC_RESOLUTION): New constants.
(make_timespec): New function.
* lib/dtotimespec.c (dtotimespec):
* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
* lib/utimens.c (validate_timespec):
* lib/utimensat.c (rpl_utimensat):
Use these new constants and functions.

10 years agostdio: OS X port of putc_unlocked + extern inline
Paul Eggert [Thu, 19 Sep 2013 20:25:43 +0000 (13:25 -0700)]
stdio: OS X port of putc_unlocked + extern inline

* lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms.
* doc/posix-functions/putc_unlocked.texi:
* doc/posix-functions/putchar_unlocked.texi:
Document this portability problem.

10 years agosignal: OS X port of sigaddset etc. + extern inline
Paul Eggert [Thu, 19 Sep 2013 20:24:03 +0000 (13:24 -0700)]
signal: OS X port of sigaddset etc. + extern inline

* lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
(sigismember): #undef on problematic Apple platforms.
* doc/posix-functions/sigaddset.texi:
* doc/posix-functions/sigdelset.texi:
* doc/posix-functions/sigemptyset.texi:
* doc/posix-functions/sigfillset.texi:
* doc/posix-functions/sigismember.texi:
Document this portability problem.

10 years agoextern-inline: do not always suppress extern inline on OS X
Paul Eggert [Thu, 19 Sep 2013 20:21:39 +0000 (13:21 -0700)]
extern-inline: do not always suppress extern inline on OS X

* m4/extern-inline.m4 (gl_EXTERN_INLINE): Suppress the use of
extern inline on Apple only if the particular compile-time
configuration is known to have the problem.
(_GL_EXTERN_INLINE_APPLE_BUG): New private macro, to implement this.
(_GL_EXTERN_LNLINE_IN_USE): New macro, intended for use by
other Gnulib modules.

10 years agoextern-inline: document fixes for ctype and wctype macros
Paul Eggert [Thu, 19 Sep 2013 19:57:18 +0000 (12:57 -0700)]
extern-inline: document fixes for ctype and wctype macros

* doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
* doc/posix-functions/isascii.texi, doc/posix-functions/isblank.texi:
* doc/posix-functions/iscntrl.texi, doc/posix-functions/isdigit.texi:
* doc/posix-functions/isgraph.texi, doc/posix-functions/islower.texi:
* doc/posix-functions/isprint.texi, doc/posix-functions/ispunct.texi:
* doc/posix-functions/isspace.texi, doc/posix-functions/isupper.texi:
* doc/posix-functions/iswalnum.texi, doc/posix-functions/iswalpha.texi:
* doc/posix-functions/iswcntrl.texi, doc/posix-functions/iswctype.texi:
* doc/posix-functions/iswdigit.texi, doc/posix-functions/iswgraph.texi:
* doc/posix-functions/iswlower.texi, doc/posix-functions/iswprint.texi:
* doc/posix-functions/iswpunct.texi, doc/posix-functions/iswspace.texi:
* doc/posix-functions/iswupper.texi, doc/posix-functions/iswxdigit.texi:
* doc/posix-functions/isxdigit.texi, doc/posix-functions/toascii.texi:
* doc/posix-functions/memcpy.texi, doc/posix-functions/memmove.texi:
* doc/posix-functions/memset.texi, doc/posix-functions/stpcpy.texi:
* doc/posix-functions/stpncpy.texi, doc/posix-functions/strcat.texi:
* doc/posix-functions/strcpy.texi, doc/posix-functions/strncat.texi:
* doc/posix-functions/strncpy.texi:
* doc/posix-functions/tolower.texi, doc/posix-functions/toupper.texi:
* doc/posix-functions/towlower.texi, doc/posix-functions/towupper.texi:
Document that Gnulib fixes portability problems with these
functions on OS X 10.8 and earlier when called from plain inline
or extern inline functions.

10 years agofflush, freadahead, fseeko: Fix for Android
Kevin Cernekee [Sat, 7 Sep 2013 03:00:38 +0000 (20:00 -0700)]
fflush, freadahead, fseeko: Fix for Android

* lib/stdio-impl.h: Use local __sfileext definition.

Suggested by Bruno Haible in:
<http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00306.html>

fflush, freadahead, and fseeko have trouble compiling on Android[1]
because they need access to internal elements of the FILE struct.
Bionic libc[2], like OpenBSD libc[3], puts the ungetc buffer "_ub"
at the beginning of the __sfileext struct.  Therefore we can reuse the
existing OpenBSD implementation for Android.

Test results (Android 4.2.2, ARMv7, NDK r9):

    root@android:/data/local/tmp # export srcdir=`pwd`
    root@android:/data/local/tmp # ./test-fflush2.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-freadahead.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko2.sh ; echo $?
    Skipping test: ungetc cannot handle arbitrary bytes
    77
    root@android:/data/local/tmp # ./test-fseeko3.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko4.sh ; echo $?
    0

[1] http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00295.html
[2] https://android.googlesource.com/platform/bionic/+/android-4.3_r2.2/libc/stdio/fileext.h
[3] http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=1.2;content-type=text%2Fplain

10 years agopmccabe2html: fix portability issues
Mats Erik Andersson [Thu, 19 Sep 2013 17:47:29 +0000 (19:47 +0200)]
pmccabe2html: fix portability issues

Allow awk versions other than Gawk.
Correct wrong HTML tag closures.

10 years agogetgroups: statement without effect
Mats Erik Andersson [Wed, 18 Sep 2013 16:04:26 +0000 (18:04 +0200)]
getgroups: statement without effect

* lib/getgroups.c (rpl_getgroups) [HAVE_GETGROUPS]:
Change equality conditional to expected assignment.

10 years agoautoupdate
Karl Berry [Fri, 13 Sep 2013 22:25:29 +0000 (15:25 -0700)]
autoupdate

10 years agoupdate from texinfo
Karl Berry [Fri, 13 Sep 2013 14:02:33 +0000 (07:02 -0700)]
update from texinfo

10 years agoupdate from texinfo
Karl Berry [Wed, 11 Sep 2013 16:29:59 +0000 (09:29 -0700)]
update from texinfo

10 years agoglob: fix compilation
Eric Blake [Mon, 9 Sep 2013 12:23:44 +0000 (06:23 -0600)]
glob: fix compilation

Sometimes, it just isn't my day.  The previous patch missed an #endif.

* lib/glob.in.h (__THROW): Fix missing line in previous commit.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoglob: fix build for platforms without __THROW
Eric Blake [Sat, 7 Sep 2013 13:23:32 +0000 (07:23 -0600)]
glob: fix build for platforms without __THROW

The previous fix for glibc broke builds on non-glibc platforms
that don't pre-define __THROW.  Perhaps we could make the code
more optimal by using gcc attributes instead of expanding to
nothing, to match the glibc usage; but for now this fixes the
build.  Reproted by Tom G. Christensen.

* lib/glob.in.h (__THROW): Add definition again.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoautoupdate
Karl Berry [Fri, 6 Sep 2013 12:36:05 +0000 (05:36 -0700)]
autoupdate

10 years agoregex-quote: fix buffer access out of bounds
Anton Ovchinnikov [Thu, 5 Sep 2013 00:09:39 +0000 (17:09 -0700)]
regex-quote: fix buffer access out of bounds

http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00001.html
* lib/regex-quote.c (regex_quote_spec_pcre):
Fix typo that resulted in an out-of-bounds read.

10 years agoglob: avoid -Wattribute warnings on glibc
Eric Blake [Wed, 4 Sep 2013 23:06:35 +0000 (17:06 -0600)]
glob: avoid -Wattribute warnings on glibc

Colin Watson reported that some versions of gcc warn about the use
of attribute((leaf)) on static functions, since it is documented to
have an effect only on external functions.

* lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use
__THROWNL, not __THROW, on static functions.
* lib/glob.in.h (__THROW): Adjust...
(__THROWNL): ...accordingly.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoheaders: check that _GL_INLINE_HEADER_BEGIN is defined
Paul Eggert [Thu, 29 Aug 2013 01:49:38 +0000 (18:49 -0700)]
headers: check that _GL_INLINE_HEADER_BEGIN is defined

Suggested by Bruce Korb in:
http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html
* doc/extern-inline.texi (extern inline):
Suggest checking that _GL_INLINE_HEADER_BEGIN is defined.
* lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h:
* lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h:
* lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h:
* lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h:
* lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h:
* lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h:
* lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h:
* lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h:
* lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h:
* lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h:
* lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h:
* lib/xtime.h:
Check that _GL_INLINE_HEADER_BEGIN is defined.

10 years agobootstrap: remove the --version requirement from ancillary tools
Pádraig Brady [Sun, 18 Aug 2013 01:05:51 +0000 (02:05 +0100)]
bootstrap: remove the --version requirement from ancillary tools

* build-aux/bootstrap (check_exists): A new refactored function to
determine if a command exists.
(find_tool): Use the new function which does not require the
--version option to be supported.
(check_versions): Use the new function.

10 years agogc: support HMAC-SHA256 and HMAC-SHA512.
Simon Josefsson [Mon, 26 Aug 2013 19:31:15 +0000 (21:31 +0200)]
gc: support HMAC-SHA256 and HMAC-SHA512.

* lib/gc.h: Add gc_hmac_sha256 and gc_hmac_sha512.
* lib/gc-libgcrypt.c (gc_hmac_sha256, gc_hmac_sha512): New
functions.
(gc_hmac_md5): Use symbolic constant.
* lib/gc-gnulib.c: Include hmac.h for HMAC-SHA256/512 too.
(gc_hmac_sha256, gc_hmac_sha512): New functions.
* lib/hmac.h: Add hmac_sha256 and hmac_sha512 prototypes.
* m4/sha256.m4: Protect against empty expansion.
* m4/sha512.m4: Likewise.
* lib/hmac-sha256.c: New file.
* lib/hmac-sha512.c: Likewise.
* m4/gc-hmac-sha256.m4: Likewise.
* m4/gc-hmac-sha512.m4: Likewise.
* m4/gc-sha256.m4: Likewise.
* m4/gc-sha512.m4: Likewise.
* modules/crypto/gc-hmac-sha256: Likewise.
* modules/crypto/gc-hmac-sha256-tests: Likewise.
* modules/crypto/gc-hmac-sha512: Likewise.
* modules/crypto/gc-hmac-sha512-tests: Likewise.
* modules/crypto/hmac-sha256: Likewise.
* modules/crypto/hmac-sha256-tests: Likewise.
* modules/crypto/hmac-sha512: Likewise.
* modules/crypto/hmac-sha512-tests: Likewise.
* tests/test-gc-hmac-sha256.c: Likewise.
* tests/test-gc-hmac-sha512.c: Likewise
* tests/test-hmac-sha256.c: Likewise.
* tests/test-hmac-sha512.c: Likewise

10 years agogettext: update to version 0.18.3.1
Daiki Ueno [Sat, 24 Aug 2013 08:29:35 +0000 (10:29 +0200)]
gettext: update to version 0.18.3.1

* m4/intl.m4: Update from gettext-0.18.3.1, which fixes a misuse
of AC_CHECK_DECLS.

10 years agoselinux-at: omit unnecessary include
Paul Eggert [Fri, 23 Aug 2013 20:53:46 +0000 (13:53 -0700)]
selinux-at: omit unnecessary include

* lib/selinux-at.c: Don't include dosname.h; not needed, since
this source file doesn't use its macros, and subsidiary files that
use the macros already include it.

10 years agoautoupdate
Karl Berry [Thu, 22 Aug 2013 22:18:26 +0000 (15:18 -0700)]
autoupdate

10 years agod-ino: avoid false negative on symlink
Eric Blake [Wed, 21 Aug 2013 22:10:18 +0000 (16:10 -0600)]
d-ino: avoid false negative on symlink

If the first entry listed in a directory is a symlink, we
had a spurious mismatch between d_ino (which should match the
symlink) and stat() results (which chases the symlink).
Reported by Stephane Chazelas <stephane.chazelas@gmail.com>.

* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoupdate from texinfo
Karl Berry [Tue, 20 Aug 2013 18:06:51 +0000 (11:06 -0700)]
update from texinfo

10 years agoupdate debian copyright: tweak clscan and then manually fixup: revisit next release debian/20130805+stable-1
Ian Beckwith [Sat, 17 Aug 2013 13:43:58 +0000 (14:43 +0100)]
update debian copyright: tweak clscan and then manually fixup: revisit next release

10 years agoautoupdate
Karl Berry [Fri, 16 Aug 2013 13:32:22 +0000 (06:32 -0700)]
autoupdate

10 years agobootstrap: port to OpenBSD sed
Mike Miller [Tue, 13 Aug 2013 03:39:29 +0000 (23:39 -0400)]
bootstrap: port to OpenBSD sed

* build-aux/bootstrap (insert_if_absent): Port to OpenBSD sed which
does not interpret `-' as a file argument to mean stdin.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agowarnings: minor optimization
Eric Blake [Thu, 15 Aug 2013 19:45:55 +0000 (13:45 -0600)]
warnings: minor optimization

Paul Eggert suggested that expr is more efficient than echo|sed.

* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use fewer processes.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agowarnings: check -Wfoo rather than -Wno-foo
Eric Blake [Wed, 14 Aug 2013 23:02:58 +0000 (17:02 -0600)]
warnings: check -Wfoo rather than -Wno-foo

As reported by Christophe Fergeau and others, use of the
warnings modules is awkward when probing for negative
warning flags.  For example, clang recognizes
-Wno-unused-command-line-argument, but gcc does not;
gcc silently ignores unknown warnings in isolation, but when
something else also causes a compilation problem, gcc then
compounds the overall message by also complaining about the
unrecongized command line option at that time.  The gcc manual
documents that this behavior is intentional so that someone
can add a -Wno-foo silencer to CFLAGS for a warning that older
gcc does not understand, and where the warning is undesired
under newer gcc; it also documents that probing for the -Wfoo
positive form of the error is a reliable way to tell if the
negative form will actually suppress anything.  Clang will
warn for both positive and negative forms of an unknown
option.

Since common usage includes:

for w in $list; do
  gl_WARN_ADD([$w])
done

the solution must be polymorphic to work on both m4 literals
and shell variables (similar to AS_VAR_SET polymorphism).

* m4/warnings.m4 (gl_COMPILER_OPTION_IF): If name begins with
-Wno-, test if the compiler recognizes the positive form instead.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoaccept doclicense option
Karl Berry [Thu, 15 Aug 2013 18:01:29 +0000 (11:01 -0700)]
accept doclicense option

10 years agoaccept doclicense option
Karl Berry [Thu, 15 Aug 2013 18:01:13 +0000 (11:01 -0700)]
accept doclicense option

10 years agoxvasprintf-tests: port to GCC with hardening flags
Paul Eggert [Tue, 13 Aug 2013 20:47:29 +0000 (13:47 -0700)]
xvasprintf-tests: port to GCC with hardening flags

* tests/test-xvasprintf.c (test_xasprintf): Pass another arg to
xasprintf, to pacify GCC.  Reported by Santiago Vila in:
http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00002.html

10 years agofpending: port to recent Cygwin change to stdio_ext.h
Paul Eggert [Sun, 11 Aug 2013 23:36:16 +0000 (16:36 -0700)]
fpending: port to recent Cygwin change to stdio_ext.h

Reported by LRN in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00028.html>.
* lib/fpending.h: Don't worry about HAVE_DECL___FPENDING;
just declare __fpending unless it's a macro.
A duplicate decl shouldn't hurt.
* m4/fpending.m4 (gl_FUNC_FPENDING): Check that an __fpending
call compiles and links, instead of separately checking for
decl and lib function.
* modules/fpending (configure-ac):
Adjust to fpending.m4's renaming of shell variable.

10 years agoupdate debian/copyright
Ian Beckwith [Sun, 11 Aug 2013 20:17:15 +0000 (21:17 +0100)]
update debian/copyright

10 years agono need for tendentious comment
Karl Berry [Sun, 11 Aug 2013 15:35:08 +0000 (08:35 -0700)]
no need for tendentious comment

10 years agoregenerate
Karl Berry [Sun, 11 Aug 2013 15:31:43 +0000 (08:31 -0700)]
regenerate

10 years agoautoupdate
Karl Berry [Sun, 11 Aug 2013 15:30:18 +0000 (08:30 -0700)]
autoupdate

10 years agofix gnulib-tool --version; also show snapshot and debian package version
Ian Beckwith [Sun, 11 Aug 2013 14:12:41 +0000 (15:12 +0100)]
fix gnulib-tool --version; also show snapshot and debian package version

10 years agobump standards-version (3.9.4);update overrides
Ian Beckwith [Sun, 11 Aug 2013 12:12:22 +0000 (13:12 +0100)]
bump standards-version (3.9.4);update overrides

10 years agorefresh patches
Ian Beckwith [Sun, 11 Aug 2013 11:36:31 +0000 (12:36 +0100)]
refresh patches

10 years agosys_time: port to OpenBSD
Paul Eggert [Sun, 11 Aug 2013 05:02:58 +0000 (22:02 -0700)]
sys_time: port to OpenBSD

* lib/sys_time.in.h: Simply delegate to the system's header
in the BSDish cases as well.  Problem reported by Mike Miller in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00016.html>.
* tests/test-sys_select.c, tests/test-sys_time.c (verify_tv_sec_type):
Allow platforms like 64-bit OpenBSD where timeval's tv_sec is
wider than time_t.

10 years agoautoupdate
Karl Berry [Sat, 10 Aug 2013 14:10:55 +0000 (07:10 -0700)]
autoupdate

10 years agobootstrap: support checksum utils without a --status option
Pádraig Brady [Thu, 8 Aug 2013 10:08:49 +0000 (11:08 +0100)]
bootstrap: support checksum utils without a --status option

* build-aux/bootstrap: Only look for sha1sum if updating po files.
Add sha1 to the list of supported checksum utils since it's now
supported through adjustments below.
(update_po_files): Remove the use of --status
in a way that will suppress all error messages, but since this is
only used to minimize updates, it shouldn't cause an issue.
Exit early if there is a problem updating the po file checksums.
(find_tool): Remove the check for --version support as this
is optional as per commit 86186b17.  Don't even check for the
presence of the command as if that is needed, it's supported
through configuring prerequisites in bootstrap.conf.
Prompt that when a tool isn't found, one can define an environment
variable to add to the hardcoded search list.

10 years agoupdate from texinfo
Karl Berry [Fri, 9 Aug 2013 16:27:34 +0000 (09:27 -0700)]
update from texinfo

10 years agoFix ChangeLog typo.
Paul Eggert [Fri, 9 Aug 2013 15:49:19 +0000 (08:49 -0700)]
Fix ChangeLog typo.

10 years agoautoupdate
Karl Berry [Fri, 9 Aug 2013 15:03:30 +0000 (08:03 -0700)]
autoupdate

10 years agoregex: port to non-glibc/lock-using systems
Jim Meyering [Mon, 5 Aug 2013 18:24:26 +0000 (11:24 -0700)]
regex: port to non-glibc/lock-using systems

Since 29-05-2013 commit, 55ba71f4, compilation on a non-glibc
system with GNULIB_LOCK would fail due to absence of the
included "glthread/lock.h".  This would affect any package
for which the "lock" module is used only by the regex module,
and not explicitly used.
* m4/regex.m4 (gl_PREREQ_REGEX): Require gl_GLIBC21.
* modules/regex (Depends-on) [!GLIBC && $ac_use_included_regex]:
Add a dependency on the "lock" module.

10 years agoupdate from texinfo
Karl Berry [Tue, 6 Aug 2013 17:57:33 +0000 (10:57 -0700)]
update from texinfo

10 years agoMerge branch 'stable'
Ian Beckwith [Mon, 5 Aug 2013 02:31:22 +0000 (03:31 +0100)]
Merge branch 'stable'

10 years agofinalise NEWS.stable stable/20130805
Ian Beckwith [Mon, 5 Aug 2013 02:25:41 +0000 (03:25 +0100)]
finalise NEWS.stable

10 years agoNEWS.stable: log cherry-pick [03e96cc]->[78b78bc] autoupdate
Ian Beckwith [Mon, 5 Aug 2013 02:24:53 +0000 (03:24 +0100)]
NEWS.stable: log cherry-pick [03e96cc]->[78b78bc] autoupdate

10 years agoautoupdate
Karl Berry [Sat, 20 Jul 2013 21:38:08 +0000 (14:38 -0700)]
autoupdate
(cherry picked from commit 03e96cc338b5237e15fce73e9423526969ee768a)

10 years agoNEWS.stable: log cherry-pick [de3b502]->[cce1478] autoupdate
Ian Beckwith [Mon, 5 Aug 2013 02:24:12 +0000 (03:24 +0100)]
NEWS.stable: log cherry-pick [de3b502]->[cce1478] autoupdate

10 years agoautoupdate
Karl Berry [Fri, 19 Jul 2013 22:08:53 +0000 (15:08 -0700)]
autoupdate
(cherry picked from commit de3b5025bc2a19d847d727db7e0b724de09e8bdd)

10 years agoupdate NEWS.stable
Ian Beckwith [Mon, 5 Aug 2013 02:17:51 +0000 (03:17 +0100)]
update NEWS.stable

10 years agofnmatch: don't goto over declaration
Paul Eggert [Sun, 7 Jul 2013 00:12:29 +0000 (17:12 -0700)]
fnmatch: don't goto over declaration

* lib/fnmatch_loop.c (FCT): Hoist local up one level, to avoid
undefined behavior for goto over a declaration.
Problem reported by Charlie Brown in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00009.html>.
(cherry picked from commit c96bab3fee48a9df55e7366344f838e1fc785c28)

10 years agoNEWS.stable: log cherry-pick [612ef3f]->[a08b131] mgetgroups: relax license to LGPLv2+
Ian Beckwith [Mon, 5 Aug 2013 02:13:56 +0000 (03:13 +0100)]
NEWS.stable: log cherry-pick [612ef3f]->[a08b131] mgetgroups: relax license to LGPLv2+

10 years agomgetgroups: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:45:04 +0000 (15:45 -0600)]
mgetgroups: relax license to LGPLv2+

getgrouplist is part of glibc and LGPLv2+; the mgetgroups module
is merely an ease-of-use wrapper around this interface.  There's
nothing in the algorithm worth protecting by the more-restrictive
GPLv3+.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00092.html

* modules/getugroups (License): Change from GPLv3+.
* modules/mgetgroups (License): Likewise.
* modules/getgroups (License): Change from LGPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 612ef3f7eabd0630941517d225e866a7fb7a3b3e)

10 years agoNEWS.stable: log cherry-pick [33758ba]->[121180e] xalloc-oversized: relax license...
Ian Beckwith [Mon, 5 Aug 2013 02:13:37 +0000 (03:13 +0100)]
NEWS.stable: log cherry-pick [33758ba]->[121180e] xalloc-oversized: relax license to LGPLv2+

10 years agoxalloc-oversized: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:38:07 +0000 (15:38 -0600)]
xalloc-oversized: relax license to LGPLv2+

Unlike the bulk of xalloc* which calls exit() on allocation failure,
and thus is unacceptable in a library, the xalloc-oversized.h header
is a mere macro that makes checks for allocation overflow possible in
all sorts of portable code.  In fact, the LGPLv2+ module malloca
already has a copy of this check, arguing that this header is more
useful under a permissive license.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00092.html

* modules/xalloc-oversized (License): Change from GPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 33758ba748480b6e85c34894deb4e6aed15b4bd2)

10 years agonproc: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:34:30 +0000 (15:34 -0600)]
nproc: relax license to LGPLv2+

nproc merely exposes alternatives to sysconf(_SC_NPROCESSORS_CONF),
which is part of glibc and thus LGPLv2+; it is not adding any value
that strategically requires LGPLv3+.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00105.html

* modules/nproc (License): Change from LGPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 240af58aeaae7863a3adcdbc812d7646a0a5ac99)

10 years agoNEWS.stable: log cherry-pick [2845ecc]->[1fd0acc] getcwd-lgpl: port to Tru64
Ian Beckwith [Mon, 5 Aug 2013 02:08:49 +0000 (03:08 +0100)]
NEWS.stable: log cherry-pick [2845ecc]->[1fd0acc] getcwd-lgpl: port to Tru64

10 years agogetcwd-lgpl: port to Tru64
Paul Eggert [Wed, 12 Jun 2013 02:52:46 +0000 (19:52 -0700)]
getcwd-lgpl: port to Tru64

* lib/getcwd-lgpl.c: Include <stdlib.h>, for malloc etc.
Problem reported by Steven M. Schweda in
<http://lists.gnu.org/archive/html/bug-gzip/2013-06/msg00010.html>.
(cherry picked from commit 2845ecc459a4ad03de8397a2c942c2e91d2d3ed5)

10 years agoNEWS.stable: log cherry-pick [353402b]->[979b76e] autoupdate
Ian Beckwith [Mon, 5 Aug 2013 02:08:14 +0000 (03:08 +0100)]
NEWS.stable: log cherry-pick [353402b]->[979b76e] autoupdate

10 years agoautoupdate
Karl Berry [Tue, 11 Jun 2013 13:04:55 +0000 (06:04 -0700)]
autoupdate
(cherry picked from commit 353402b7070d3796ffe284a0e939ee1790f518ac)

10 years agoprepare NEWS.stable
Ian Beckwith [Mon, 5 Aug 2013 01:16:00 +0000 (02:16 +0100)]
prepare NEWS.stable

10 years agoMerge tag 'snapshot-start' into stable
Ian Beckwith [Mon, 5 Aug 2013 01:13:01 +0000 (02:13 +0100)]
Merge tag 'snapshot-start' into stable

10 years agoautoupdate
Karl Berry [Sat, 20 Jul 2013 21:38:08 +0000 (14:38 -0700)]
autoupdate

10 years agolocalecharset: make locale_charset thread-safe on Mac OS X
Daiki Ueno [Sat, 20 Jul 2013 14:03:38 +0000 (07:03 -0700)]
localecharset: make locale_charset thread-safe on Mac OS X

* lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L
instead of MB_CUR_MAX.

10 years agogettext: update to version 0.18.3
Daiki Ueno [Sat, 20 Jul 2013 01:23:31 +0000 (18:23 -0700)]
gettext: update to version 0.18.3

* m4/intl.m4, m4/po.m4: Update from gettext-0.18.3.  In particular,
require AC_PROG_SED to allow user to specify custom sed command when
generating en@quot PO file.

10 years agoautoupdate
Karl Berry [Fri, 19 Jul 2013 22:08:53 +0000 (15:08 -0700)]
autoupdate

10 years agobootstrap: use correct source when copying build-aux files
Werner LEMBERG [Fri, 21 Jun 2013 22:52:22 +0000 (00:52 +0200)]
bootstrap: use correct source when copying build-aux files

in my setup for ttfautohint (http://repo.or.cz/w/ttfautohint.git) I
have the following assignment in `bootstrap.conf':

  build_aux=gnulib

It seems that the patch below is necessary to make this really work
(at least it works for me): if I understand the issue correctly,
$build_aux is a *destination* variable, so it must not be used for the
files listed in $gnulib_extra_files which uses the directory structure
of the `gnulib' repository.

* build-aux/bootstrap (gnulib_extra_files): This variable is
relative to upstream gnulib layout, not downstream.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotmpdir: fix bug in VMS port
Paul Eggert [Wed, 17 Jul 2013 13:03:43 +0000 (06:03 -0700)]
tmpdir: fix bug in VMS port

* lib/tmpdir.c (path_search) [__VMS]: Never add slash.
See Steven M. Schweda in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00026.html>.

10 years agotmpdir: fix typo in previous change
Paul Eggert [Mon, 15 Jul 2013 21:43:20 +0000 (14:43 -0700)]
tmpdir: fix typo in previous change

10 years ago* lib/tmpdir.c: Simplify code to add slash; no need for a loop.
Paul Eggert [Mon, 15 Jul 2013 20:32:24 +0000 (13:32 -0700)]
* lib/tmpdir.c: Simplify code to add slash; no need for a loop.