Bruno Haible [Wed, 2 Nov 2011 09:07:20 +0000 (10:07 +0100)]
New module 'fchmodat', split off from module 'openat'.
* lib/openat.h (chmodat, lchmodat): Enable only if GNULIB_FCHMODAT is
defined.
* m4/fchmodat.m4: New file, extracted from m4/openat.m4.
* m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHMODAT. Don't test
for fchmodat, lchmod. Don't set HAVE_FCHMODAT.
* modules/fchmodat: New file, extracted from modules/openat.
* modules/openat (Files): Remove lib/fchmodat.c.
(configure.ac): Remove AC_LIBOBJ of fchmodat.
* modules/fchmodat-tests: New file, extracted from modules/openat-tests.
* modules/openat-tests (Files): Remove tests/test-fchmodat.c.
(Makefile.am): Remove rules for test-fchmodat.
* doc/posix-functions/fchmodat.texi: Mention module 'fchmodat' instead
of module 'openat'.
* NEWS: Mention the change.
Jim Meyering [Tue, 1 Nov 2011 17:04:21 +0000 (18:04 +0100)]
gitlog-to-changelog: provide a ChangeLog-repair mechanism
Git logs are often treated as immutable, because editing them
changes the SHA1 checksums of all descendants. Thus, errors in
git logs tend to stay there forever. However, when we generate
a ChangeLog file -- typically for distribution -- from that git log,
we can actually make corrections in the generated file. The key
lies in recording in machine-readable/applicable form the desired
corrections. See --help for description and an example.
* build-aux/gitlog-to-changelog (parse_amend_file): New function.
(usage): Describe it; alphabetize option descriptions.
(main): Honor the new option, carefully.
Paul Eggert [Tue, 1 Nov 2011 20:15:14 +0000 (13:15 -0700)]
* MODULES.html.sh: Fix sed-script shell quoting and locale issues.
(func_module): Replace foo=` ... sed -e COMPLICATED ... ` with
bar=COMPLICATED; foo=` ... sed -e "$bar" ... ` when COMPLICATED
contains (possibly-quoted) backslashes. This should avoid
all-too-common shell bugs if COMPLICATED contains backslashes in
the "wrong" places. Reported by David Evans in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00013.html>.
When 'sed' uses character ranges like A-Z, invoke it in the C locale,
because we want ASCII ranges. Is there some reason we don't use
the C locale everywhere in this script?
(func_module, top level): Avoid unwanted pathname expansion when
$repo_url_prefix or $repo_url_suffix_repl contain shell
metacharacters like '?' and '*'.
Paul Eggert [Tue, 1 Nov 2011 15:22:55 +0000 (08:22 -0700)]
* tests/test-stdalign.c (TEST_ALIGNMENT): Shrink back to 8.
mingw supports alignments only up to 8 (!). Reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00006.html>.
* doc/posix-headers/stdalign.texi (stdalign.h): Document this.
Paul Eggert [Tue, 1 Nov 2011 05:37:30 +0000 (22:37 -0700)]
stdalign: port better to MSVC and to Sun C 5.11
I think these problems were reported by Bruno Haible, in email
that I've unfortunately misplaced.
* doc/posix-headers/stdalign.texi (stdalign.h): Document more
shortcomings of MSVC and of Sun C 5.11.
* lib/stdalign.in.h (_Alignas): Omit bogus extra parenthesis
around __declspec arg.
* modules/stdalign-tests (Files): Add tests/macros.h.
* tests/test-stdalign.c: Do not include <stdlib.h>; no longer needed.
Include macros.h, for ASSERT.
(DECLARE_ALIGNED): Remove.
(TEST_ALIGNMENT): Define to 16 if alignment is supported (more likely
to catch bug), and to 1 if not (simplifies the rest of the code).
(CHECK_STATIC): Always declare the alignment test vars; that's simpler.
(CHECK_AUTO): Remove.
(CHECK_ALIGNED): Check only the alignment of the static vars,
since auto var alignment isn't supported by Sun C 5.11.
(CHECK_TYPES): Remove. All uses replaced by inline code, so that
ASSERT failures are easier to diagnose.
Dmitry V. Levin [Mon, 31 Oct 2011 15:56:52 +0000 (19:56 +0400)]
gitlog-to-changelog: fix git-log invocation
git-log mishandles date strings before 1970-01-01 UTC, and there is
no use to specify --since=1970-01-01 by default anyway.
* build-aux/gitlog-to-changelog: By default, when no --since option
was given, do not specify explicit --since option to git-log.
Jim Meyering [Sun, 30 Oct 2011 20:24:06 +0000 (21:24 +0100)]
GNUmakefile: reenable "make syntax-check" for most projects
Since Friday's commit 05e2d798, "maint.mk: don't maintain a second
build-aux variable", "syntax-check" would do nothing but succeed with
the "No version control files detected..." diagnostic (unless you
happened to override _build-aux via cfg.mk).
* top/GNUmakefile (_autoreconf, _build-aux): Move default definitions
to precede inclusion of maint.mk. Otherwise, these variables would
be used undefined in any project that does not override the default.
Dmitry V. Levin [Sun, 30 Oct 2011 01:01:00 +0000 (05:01 +0400)]
gitlog-to-changelog: treat a message with only blank lines as empty
* build-aux/gitlog-to-changelog: Move the code that removes leading and
trailing blank lines before the code that issues a warning about an
empty commit message.
Jim Meyering [Sun, 30 Oct 2011 17:12:54 +0000 (18:12 +0100)]
test-parse-datetime.c: avoid new DST-related false positive test failure
* tests/test-parse-datetime.c (gmt_offset): Determine the "gmt_offset"
based on the time/date we'll convert, not the current time.
Otherwise, the moment we cross a DST boundary like today's in
Europe, (CEST to CET), that offset ends up being one hour off.
Gary V. Vaughan [Sun, 23 Oct 2011 10:28:55 +0000 (17:28 +0700)]
maint.mk: don't maintain a second build-aux variable.
* maint.mk (build_aux): Removed. The maintainer-makefile module
depends on GNUmakefile, which already maintains a cfg.mk
overridable $(_build-aux) for projects with a non-standard
build-aux directory location, although without the $(srcdir)
prefix. Use that variable consistently instead of introducing a
second one. Adjust all call sites.
Paul Eggert [Mon, 17 Oct 2011 00:17:47 +0000 (17:17 -0700)]
crypto libraries: use stdalign
* lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
Include <stdalign.h> and <stdint.h>. Do not include <stddef.h>.
Do not include <stdlib.h> twice, in md4.c.
(UNALIGNED_P): Simplify by using alignof. Use uintptr_t, not size_t,
because we are accessing a pointer's bit-pattern, not a size.
* modules/crypto/gc-md4 (Depends-on): Add stdalign.
* modules/crypto/gc-md5, modules/crypto/gc-sha1, modules/crypto/md4:
* modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
* modules/crypto/sha512: Likewise.
Bruno Haible [Thu, 27 Oct 2011 12:44:05 +0000 (14:44 +0200)]
utimensat: Work around problem on Linux/hppa.
* lib/utimensat.c (rpl_utimensat) [Linux/hppa]: Reject invalid tv_nsec
values.
* doc/posix-functions/utimensat.texi: Mention the problem on Linux/hppa.
Jim Meyering [Tue, 25 Oct 2011 10:26:49 +0000 (12:26 +0200)]
maint.mk: exempt ENODATA from a syntax-check rule
* top/maint.mk (gl_extract_significant_defines_): Also exempt ENODATA
from the sc_prohibit_always-defined_macros syntax-check rule.
Add a comment. See this for more details:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739/focus=28795
Jim Meyering [Sun, 23 Oct 2011 20:42:25 +0000 (22:42 +0200)]
fts: close parent dir FD before returning from post-traversal fts_read
The problem: the fts-using "mkdir -p A/B; rm -rf A" would attempt to
unlink A, even though an FD open on A remained. This is suboptimal
(holding a file descriptor open longer than needed), but otherwise not
a problem on Unix-like kernels. However, on Cygwin with certain Novell
file systems, (see http://cygwin.com/ml/cygwin/2011-10/msg00365.html),
that represents a real problem: it causes the removal of A to fail
with e.g., "rm: cannot remove `A': Device or resource busy"
fts visits each directory twice and keeps a cache (fts_fd_ring) of
directory file descriptors. After completing the final, FTS_DP,
visit of a directory, RESTORE_INITIAL_CWD intended to clear the FD
cache, but then proceeded to add a new FD to it via the subsequent
FCHDIR (which calls cwd_advance_fd and i_ring_push). Before, the
final file descriptor would be closed only via fts_close's call to
fd_ring_clear. Now, it is usually closed earlier, via the final
FTS_DP-returning fts_read call.
* lib/fts.c (restore_initial_cwd): New function, converted from
the macro. Call fd_ring_clear *after* FCHDIR, not before it.
Update callers.
Reported by Franz Sirl via the above URL, with analysis by Eric Blake
in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739
Gary V. Vaughan [Sun, 23 Oct 2011 06:13:46 +0000 (13:13 +0700)]
readme-release: improve safety of release prep instructions.
* README-release: Don't git pull all branches when only master
is needed for the release process.
Run make maintainer-clean before changing trees and merging.
Don't try to run ./configure right after git pull in case files
that influence the bootstrap process have changed, move the
./configure step to after running ./bootstrap.
Don't bootstrap "one last time"... it's the first time!
Bruno Haible [Sat, 22 Oct 2011 12:25:26 +0000 (14:25 +0200)]
perror: Recognize when test program crashes.
* m4/perror.m4 (gl_FUNC_PERROR): If the test program crashes due to
strerror, set gl_cv_func_perror_works to no.
Reported by Daniel Richard G. <skunk@iskunk.org>.
Bruno Haible [Sat, 22 Oct 2011 11:52:56 +0000 (13:52 +0200)]
isfinite, isinf, isnan, signbit: Don't define as a macro in C++.
* lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_1,
_GL_MATH_CXX_REAL_FLOATING_DECL_2): nEW MACROS.
(isfinite, isinf, isnan, signbit): In C++, define as overloaded
functions, not as a macro.
* tests/test-math-c++.cc (REAL_FLOATING_CHECK, OVERLOADED_CHECK): New
macros.
(isfinite, isinf, isnan, signbit): Check overloaded functions and
absence of macro.
Suggested by Eric Blake.
Reported by Michael Goffioul <michael.goffioul@gmail.com>.
Bruno Haible [Fri, 21 Oct 2011 00:45:21 +0000 (02:45 +0200)]
openpty, posix_openpt: Remove code duplication.
* lib/posix_openpt.c: Add comments about platforms, from lib/openpty.c.
* lib/openpty.c: Include <stdlib.h>.
(openpty): Use posix_openpt on all platforms except IRIX.
* modules/openpty (Depends-on): Add posix_openpt. Add conditions.
Bruno Haible [Thu, 20 Oct 2011 15:44:40 +0000 (17:44 +0200)]
posix_openpt: Support for OpenBSD.
* lib/posix_openpt.c [OpenBSD]: Include <sys/ioctl.h>, <sys/tty.h>.
(posix_openpt) [OpenBSD]: New code.
* lib/grantpt.c: Include <fcntl.h>.
(grantpt) [OpenBSD]: Only test whether fd is valid, nothing else.
* modules/grantpt (Depends-on): Add fcntl-h.
Bruno Haible [Wed, 19 Oct 2011 09:49:39 +0000 (11:49 +0200)]
posix_openpt: Fix compilation error.
* lib/posix_openpt.c (posix_openpt): Renamed from posix_openpty.
* doc/posix-functions/posix_openpt.texi: Mention ENOENT error code.
Mention the openpty module as an alternative.
Bruno Haible [Wed, 19 Oct 2011 09:09:37 +0000 (11:09 +0200)]
Support for old NeXTstep 3.3 frexp().
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm. Limit the
execution time of the test to 5 seconds.
Reported by Daniel Richard G. <skunk@iskunk.org>.
Bruno Haible [Wed, 19 Oct 2011 08:38:07 +0000 (10:38 +0200)]
Support for old NeXTstep 3.3 sed.
* m4/absolute-header.m4 (gl_ABSOLUTE_HEADER_ONE): In the sed address
part, use /.../, not \|...|. Escape periods in the header file name.
* m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise.
Reported by Daniel Richard G. <skunk@iskunk.org>.
Bruno Haible [Sat, 15 Oct 2011 15:06:24 +0000 (17:06 +0200)]
xstrtoll: Fix compilation failure.
* lib/xstrtol.c (ULLONG_MAX, LLONG_MAX, LLONG_MIN): New macros, taken
from lib/strtol.c.
* doc/posix-headers/limits.texi: Mention missing numerical limits on
some platforms.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Bruno Haible [Tue, 11 Oct 2011 00:59:23 +0000 (02:59 +0200)]
sinl: Simplify for platforms where 'long double' == 'double'.
* lib/sinl.c (sinl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New alternative
implementation.
* m4/sinl.m4 (gl_FUNC_SINL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine SINL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/sinl (Depends-on): Add sin. Update conditions.
(configure.ac): Don't compile sincosl.c and trigl.c if
HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
Jim Meyering [Mon, 10 Oct 2011 06:49:37 +0000 (08:49 +0200)]
test-renameat: don't leave behind a temporary file
* tests/test-renameat.c (main): Don't forget to remove a temporary file.
ERROR: files left in build directory after distclean:
./gltests/test-renameat.too
make[1]: *** [distcleancheck] Error 1
Reported by Tom G. Christensen.
Bruno Haible [Mon, 10 Oct 2011 00:29:53 +0000 (02:29 +0200)]
rint: Determine RINT_LIBM correctly on AIX 7.
* m4/mathfunc.m4 (gl_MATHFUNC): Try to invoke the function also
directly, not only through a function pointer. Also accept an optional
4th argument with extra code.
* m4/rint.m4 (gl_FUNC_RINT): Pass an extra code that gets turned into a
rintf() call by gcc when optimizing.
Bruno Haible [Sun, 9 Oct 2011 23:08:51 +0000 (01:08 +0200)]
rintl: Simplify for platforms where 'long double' == 'double'.
* lib/rintl.c: Include <config.h>.
(rintl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function.
* lib/rint.c [!USE_LONG_DOUBLE]: Don't include <config.h> a second
time.
* m4/rintl.m4 (gl_FUNC_RINTL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine RINTL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/rintl (Depends-on): Add rint. Update conditions.
Bruno Haible [Sun, 9 Oct 2011 23:07:15 +0000 (01:07 +0200)]
roundl: Simplify for platforms where 'long double' == 'double'.
* lib/roundl.c: Include <config.h>.
(roundl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function.
* lib/round.c [!USE_LONG_DOUBLE]: Don't include <config.h> a second
time.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine ROUNDL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/roundl (Depends-on): Add round. Update conditions.
Bruno Haible [Sun, 9 Oct 2011 23:05:53 +0000 (01:05 +0200)]
truncl: Simplify for platforms where 'long double' == 'double'.
* lib/truncl.c: Include <config.h>.
(truncl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function.
* lib/trunc.c [!USE_LONG_DOUBLE]: Don't include <config.h> a second
time.
* m4/truncl.m4 (gl_FUNC_TRUNCL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine TRUNCL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/truncl (Depends-on): Add trunc. Update conditions.
Bruno Haible [Sun, 9 Oct 2011 23:04:13 +0000 (01:04 +0200)]
ceill: Simplify for platforms where 'long double' == 'double'.
* lib/ceill.c: Include <config.h>.
(ceill) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function.
* lib/ceil.c [!USE_LONG_DOUBLE]: Don't include <config.h> a second
time.
* m4/ceill.m4 (gl_FUNC_CEILL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine CEILL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/ceill (Depends-on): Add ceil. Update conditions.
Bruno Haible [Sun, 9 Oct 2011 22:29:05 +0000 (00:29 +0200)]
floorl: Simplify for platforms where 'long double' == 'double'.
* lib/floorl.c: Include <config.h>.
(floorl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function.
* lib/floor.c [!USE_LONG_DOUBLE]: Don't include <config.h> a second
time.
* m4/floorl.m4 (gl_FUNC_FLOORL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine FLOORL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/floorl (Depends-on): Add floor. Update conditions.