Bruno Haible [Sat, 27 Nov 2010 03:08:53 +0000 (04:08 +0100)]
iconv-h: Fix test-iconv-h-c++ failure on Solaris 11 2010-11.
* lib/iconv.in.h (iconv_open, iconv, iconv_close): Define only if the
'iconv' module is present.
(ICONV_CONST): New macro.
* m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): Initialize GNULIB_ICONV and
ICONV_CONST.
* m4/iconv.m4 (AM_ICONV): If the gnulib module 'iconv-h' is present,
set ICONV_CONST.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Don't set ICONV_CONST
here.
* modules/iconv (configure.ac): Invoke gl_ICONV_MODULE_INDICATOR.
* modules/iconv-h (Makefile.am): Substitute GNULIB_ICONV.
* tests/test-iconv-h.c (ICONV_CONST): Don't define here.
* tests/test-iconv-h-c++.cc (ICONV_CONST): Don't define here.
(iconv_open, iconv, iconv_close): Test only if the 'iconv' module is
present.
Paul Eggert [Wed, 24 Nov 2010 20:05:43 +0000 (12:05 -0800)]
stdint: port to GCC 4.3 + OSX + Octave
On this platform, stdint.h is buggy and defines int64_t to long
long int. The replacement defined it to long int, causing
problems with C++ style name mangling. Instead, trust the system
definition if INT64_MAX is defined, and likewise for the unsigned
variant. Problem reported by Jarno Rajahalme in
<http://lists.gnu.org/archive/html/bug-gnulib/2010-04/msg00143.html>.
* lib/stdint.in.h (GL_INT64_T): Define if INT64_MAX is defined,
and don't mess with int64_t and INT64_MAX in this case.
(GL_UINT64_T): Likewise for UINT64_MAX and uint64_t.
Ben Pfaff [Tue, 23 Nov 2010 04:50:41 +0000 (20:50 -0800)]
Uninstall ".bin" files installed by relocwrapper.
* modules/relocatable-prog-wrapper (uninstall-relocwrapper):
Recursively run "make uninstall" with ".bin" prefixed to EXEEXT,
unless it is already there.
Bruno Haible [Sun, 21 Nov 2010 20:31:19 +0000 (21:31 +0100)]
Update for NetBSD 5.0.
* m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Don't guess yes on
NetBSD; the test fails on NetBSD 5.0.
* doc/{glibc,posix,pastposix}-{headers,functions}/*.texi: Update info
about NetBSD.
Bruno Haible [Sun, 21 Nov 2010 17:42:29 +0000 (18:42 +0100)]
Update for MacOS X 10.5.
* m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Don't guess yes on
MacOS X; the test fails on MacOS X 10.5.8.
* doc/{glibc,posix,pastposix}-{headers,functions}/*.texi: Update info
about MacOS X.
Joel E. Denny [Sat, 20 Nov 2010 14:37:45 +0000 (09:37 -0500)]
bootstrap: add bootstrap_sync option.
See discussion at
<http://lists.gnu.org/archive/html/bug-gnulib/2010-10/msg00369.html>,
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00200.html>.
* build-aux/bootstrap: Accept --bootstrap-sync to update
bootstrap if it is not identical to the local gnulib's
bootstrap. Accept bootstrap_sync=true in bootstrap.conf to
enable this by default. Accept --no-bootstrap-sync to disable
it.
Paul Eggert [Fri, 19 Nov 2010 22:36:12 +0000 (14:36 -0800)]
ftoastr: don't assume snprintf
* lib/ftoastr.c (snprintf) [! GNULIB_SNPRINTF_POSIX]:
Implement a subset of snprintf here, by using sprintf safely.
* modules/ftoastr (Depends-on): Remove snprintf.
Paul Eggert [Fri, 19 Nov 2010 05:30:29 +0000 (21:30 -0800)]
ftoastr: depend on snprintf, improve comments
* lib/ftoastr.c: Also mention Loitsch's draft.
* lib/ftoastr.h: Require WIDTH to be nonnegative. This isn't
needed in the current implementation, but it might simplify
speeding up the code later.
* modules/ftoastr: Depend on snprintf; this improves portability.
Suggested by Bruno Haible in the same email.
Paul Eggert [Fri, 19 Nov 2010 01:31:52 +0000 (17:31 -0800)]
ftoastr: port to hosts lacking strtof and strtold
Problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00242.html>.
* lib/ftoastr.c (STRTOF): Define to strtod if in a pre-C99
environment and strtold (and presumably strtof) are not available.
* modules/ftoastr (Files): Add m4/c-strtod.m4.
(configure.ac): Require gl_C99_STRTOLD.
Bruno Haible [Fri, 19 Nov 2010 00:57:49 +0000 (01:57 +0100)]
c-strtold: Avoid link error on AIX 7.
* lib/c-strtod.c: Test also HAVE_STRTOD_L or HAVE_STRTOLD_L.
* m4/c-strtod.m4 (gl_C_STRTOD): Test whether strtod_l exists.
(gl_C_STRTOLD): Test whether strtold_l exists.
Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>.
Paul Eggert [Thu, 18 Nov 2010 00:29:40 +0000 (16:29 -0800)]
intprops: new macro INT_BITS_STRLEN_BOUND
* lib/intprops.h (INT_BITS_STRLEN_BOUND): New macro, needed by
ftoastr.h. This exposes an internal of intprops.h that was formerly
not exposed. Also, it uses a slightly tighter bound than before;
though this makes no practical difference, we might as well be as
tight as we easily can.
Paul Eggert [Mon, 15 Nov 2010 18:18:52 +0000 (10:18 -0800)]
bootstrap: port to Solaris sed
* build-aux/bootstrap (get_version): Port to Solaris sed.
See Ralf Wildenhues's note in
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00156.html>.
Jim Meyering [Sat, 13 Nov 2010 21:25:32 +0000 (22:25 +0100)]
remove autoconf-2.57 work-around requiring AC_PROG_EGREP and AC_PROG_CPP
Now we require at least autoconf-2.59, which means that
the work-around is no longer needed.
* m4/alloca.m4 (gl_FUNC_ALLOCA): Remove work-around.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/mmap-anon.m4 (gl_FUNC_MMAP_ANON): Likewise.
* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Likewise.
* m4/strtoumax.m4 (gl_FUNC_STRTOUMAX): Likewise.
Bruno Haible [Sat, 13 Nov 2010 23:57:14 +0000 (00:57 +0100)]
rename, renameat: Avoid test failures at NFS mounted locations.
* tests/test-rename.h (dentry_exists, assert_nonexistent): New
functions.
(test_rename): Use assert_nonexistent.
* tests/test-rename.c: Include <dirent.h>.
* tests/test-renameat.c: Likewise.
Reported by Gary V. Vaughan <gary@gnu.org>.
Bruno Haible [Sat, 13 Nov 2010 23:55:37 +0000 (00:55 +0100)]
rename, renameat: Document Linux bug with NFS.
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00154.html>.
* doc/posix-functions/rename.texi: Mention the NFS bug on Linux.
* doc/posix-functions/renameat.texi: Likewise.
Suggested by Eric Blake.
Bruno Haible [Sat, 13 Nov 2010 18:43:06 +0000 (19:43 +0100)]
unistr/u8-mbtouc: Improve handling of ill-formed UTF-8 input.
* lib/unistr/u8-mbtouc.c (u8_mbtouc): For an invalid multibyte
character, return the number of bytes that belong together, not always
1.
* lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise.
* lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise.
* lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise.
* lib/unistr/u8-mbsnlen.c (u8_mbsnlen): Use u8_mbtouc to determine the
number of bytes of an invalid character.
* tests/unistr/test-u8-mbtouc.c (test_safe_function): New function.
(main): Invoke it.
* tests/unistr/test-u8-mbtouc.h (test_function): Update two test results.
* tests/unistr/test-u8-mbsnlen.c (main): Test various kinds of
malformed byte sequences.
* modules/unistr/u8-mbtouc (configure.ac): Bump version number.
* modules/unistr/u8-mbtouc-unsafe (configure.ac): Likewise.
* modules/unistr/u8-mbsnlen (configure.ac): Likewise.
Reported by Ben Pfaff and Paolo Bonzini.
Bruno Haible [Sat, 13 Nov 2010 14:25:14 +0000 (15:25 +0100)]
openat: Work around glibc bug with fchownat() and empty file names.
* m4/openat.m4 (gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): New macro.
(gl_FUNC_FCHOWNAT): Invoke it.
* lib/fchownat.c (rpl_fchownat): Handle the empty file name specially.
* doc/posix-functions/fchownat.texi: Document the glibc bug.
Reported by Gary V. Vaughan <gary@gnu.org>.
Jim Meyering [Sat, 13 Nov 2010 09:51:06 +0000 (10:51 +0100)]
init.sh: ensure that IFS is defined, just in case...
* tests/init.sh (setup_): Ensure that IFS is defined,
so that saving and restoring it works as expected. This
appears to be useful at least for an old version of dash
from a long time ago (RH 6). See here for details:
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/436/focus=455
Jim Meyering [Sat, 13 Nov 2010 09:43:08 +0000 (10:43 +0100)]
maint.mk: tighten "test a == b" check
* top/maint.mk (sc_prohibit_test_double_equal): Restrict this
test to files that contain something like #!/bin/sh.
Without this, coreutils would get two false positives in
the comments of C source files.
* build-aux/bootstrap (get_version): Parse FreeBSD gzip version,
which has no '.' and goes to stderr.
* build-aux/bootstrap.conf (buildreq): Improve the sample file.
Reported by Matthias Bolte.
Bruno Haible [Thu, 11 Nov 2010 12:15:28 +0000 (13:15 +0100)]
New module 'strerror_r-posix'.
* lib/string.in.h (strerror_r): New declaration.
* lib/strerror_r.c: New file.
* m4/strerror_r.m4: New file.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Check for the declaration
of strerror_r.
(gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_STRERROR_R,
HAVE_DECL_STRERROR_R, REPLACE_STRERROR_R.
* modules/strerror_r-posix: New file.
* modules/string (Makefile.am): Substitute GNULIB_STRERROR_R,
HAVE_DECL_STRERROR_R, REPLACE_STRERROR_R.
* doc/posix-functions/strerror_r.texi: Mention the new module and the
portability problems.
Torsten Scheck [Wed, 10 Nov 2010 08:15:44 +0000 (09:15 +0100)]
pmccabe2html: bug fixes: don't skip last input line; quote filename in shell command
* build-aux/pmccabe2html: Fixed a off-by-one error, so last input line is
also considered for output. Quoted function name in shell command, so
temporary files for functions like MyClass::operator() are removed
correctly without errors.
Signed-off-by: Simon Josefsson <simon@josefsson.org>
Paul Eggert [Mon, 8 Nov 2010 05:58:54 +0000 (21:58 -0800)]
fdopendir: fix bug on MacOS X when low on file descriptors
* lib/fdopendir.c (REPLACE_FCHDIR): #define to 0 if not defined.
(fdopendir_with_dup, fd_clone_opendir): Now have extra CWD arg.
All callers changed.
(fdopendir): Invoke save_cwd at the top level, not after using
multiple dup() calls to use up file descriptors. Then retry
fdopendir_with_dup. This avoids failure with EMFILE if FD is 1
less than the maximum number of open file descriptors, because
save_cwd fails with errno == EMFILE. Problem reported by tsteven4
on Mac OS X 10.6.4 for tar 1.24
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00084.html>
<http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00000.html>
and for tar 1.25
<http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00038.html>.
Bruno Haible [Sun, 7 Nov 2010 17:50:19 +0000 (18:50 +0100)]
vasnprintf: Support I flag on glibc systems.
* lib/printf-parse.h (FLAG_LOCALIZED): New macro.
* lib/printf-parse.c (PRINTF_PARSE): Handle the 'I' flag.
* lib/vasnprintf.c (VASNPRINTF): Pass the 'I' flag on to the system's
snprintf function.
* tests/test-vasnprintf-posix.c (test_function): Test the 'I' flag on
glibc systems.
* tests/test-vasnprintf-posix3.c: New file.
* modules/vasnprintf-posix-tests (Files): Add it.
(TESTS, check_PROGRAMS): Add test-vasnprintf-posix3.
Eric Blake [Fri, 5 Nov 2010 21:26:35 +0000 (15:26 -0600)]
ceil, floor: avoid spurious failure with icc
* tests/test-ceilf2.c (ceilf_reference): Avoid icc's use of DAZ
[denormals-as-zero] when optimizing without -mieee-fp option.
* tests/test-floorf2.c (floorf_reference): Likewise.
* tests/test-ceilf1.c (dummy): New function.
(main): Use it to outsmart icc's optimization.
* tests/test-floorf1.c (dummy, main): Likewise.
Bruno Haible [Wed, 27 Oct 2010 00:53:42 +0000 (02:53 +0200)]
stdio: Work around compilation error due to renameat() on Solaris 10.
* lib/stdio.in.h: Include <unistd.h> on Solaris.
* lib/renameat.c: Don't include <unistd.h> here.
* doc/posix-functions/renameat.texi: Mention the Solaris problem.
Reported by Paul Eggert and Eric Blake.
Paul Eggert [Tue, 26 Oct 2010 20:48:34 +0000 (13:48 -0700)]
renameat: port to Solaris 10, which declares renameat in unistd.h
* lib/renameat.c: Include unistd.h before stdio.h, because
Solaris 10 declares renameat in unistd.h. Problem encountered
when building GNU tar 1.24 on Solaris 10.
Paul Eggert [Sun, 24 Oct 2010 17:11:16 +0000 (10:11 -0700)]
inttostr: simplify by removing unnecessary redundancy
* lib/anytostr.c: Don't include verify.h.
(anytostr): Don't verify that TYPE_SIGNED (inttype) equals
inttype_is_signed. Instead, disable the bogus GCC warnings, so that
there's no need for inttype_is_signed and for calling TYPE_SIGNED.
* lib/imaxtostr.c (inttype_is_signed): Remove; no longer needed.
* lib/inttostr.c, lib/offtostr.c, lib/uinttostr.c, lib/umaxtostr.c:
Likewise.
* modules/inttostr (Depends-on): Remove 'verify'.
Bruno Haible [Sat, 23 Oct 2010 11:38:11 +0000 (13:38 +0200)]
Tests: Fix LOCALE_JA on MirBSD 10.
* m4/locale-ja.m4 (gt_LOCALE_JA): Reject a locale identifier that leads
to an UTF-8 locale.
* m4/locale-fr.m4 (gt_LOCALE_FR): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
Reported by Eric Blake.
Paul Eggert [Fri, 22 Oct 2010 18:14:17 +0000 (11:14 -0700)]
inttostr: simplify by removing unnecessary redundancy
* lib/anytostr.c: Don't include verify.h.
(anytostr): Don't verify that TYPE_SIGNED (inttype) equals
inttype_is_signed. Instead, use TYPE_SIGNED (inttype) directly.
This removes the need for inttype_is_signed, which was put in to
suppress some GCC warnings about conversions. This rewrite should
also suppress those warnings.
* lib/imaxtostr.c (inttype_is_signed): Remove; no longer needed.
* lib/inttostr.c, lib/offtostr.c, lib/uinttostr.c, lib/umaxtostr.c:
Likewise.
* modules/inttostr (Depends-on): Remove 'verify'.
Joel E. Denny [Sat, 16 Oct 2010 20:54:23 +0000 (16:54 -0400)]
bootstrap: anchor .gitignore entries.
* build-aux/bootstrap (insert_sorted_if_absent): Replace all uses
with...
(insert_vc_ignore): ... this new function, which prepends `/' to
all .gitignore entries before passing them to
insert_sorted_if_absent.
Jim Meyering [Fri, 15 Oct 2010 18:12:52 +0000 (20:12 +0200)]
GNUmakefile: handle "stable" target, not "major"
* top/GNUmakefile (_is-dist-target): s/major/stable/ to match the
lists in maint.mk and announce-gen. Without this, "make stable"
would fail to ensure that $(VERSION) is up to date.
Jim Meyering [Wed, 13 Oct 2010 20:11:31 +0000 (22:11 +0200)]
git-version-gen: do require git-VC'd files in cwd
* build-aux/git-version-gen: Reject a git version string
if there are no commits associated with the current directory.
This avoids an unlikely false-positive (unrelated dir whose parent
repository also contains a tag matching v*), as pointed out
by Giuseppe Scrivano in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/21843/focus=23664