Jim Meyering [Mon, 3 May 2010 16:30:38 +0000 (18:30 +0200)]
test-xalloc-die: avoid unwarranted test failure on OpenSolaris 5.11
* tests/test-xalloc-die.sh: Redirect stdout before stderr, (i.e.,
"> out 2> err", rather than "2> err > out"). Otherwise, with /bin/sh
on OpenSolaris 5.11 snv_134, we would end up with a stray "1> out"
line in the "err2" output file when running "make check" in verbose
mode (i.e., with set -x enabled).
Jim Meyering [Mon, 3 May 2010 08:08:20 +0000 (10:08 +0200)]
maint.mk: prohibit unwarranted use of <strings.h>
* top/maint.mk (sc_prohibit_strings_without_use): Reject inclusion of
strings.h in a file that does not also use strcasecmp, strncasecmp,
ffs or ffsll.
Eric Blake [Wed, 28 Apr 2010 16:13:24 +0000 (10:13 -0600)]
canonicalize-lgpl: avoid compiler warning
* lib/canonicalize-lgpl.c (versioned_symbol): Avoid an 'empty
declaration' / 'extraneous semicolon' warning with some compilers.
Reported by Andreas Gruenbacher.
Jim Meyering [Tue, 27 Apr 2010 15:29:03 +0000 (17:29 +0200)]
maint.mk: fix a bug introduced in last change
* top/maint.mk (gl_assured_headers_): Now that all names are on
one line, use sed's "g" modifier. Note that while the \.in\.h LHS
is not anchored to end of word, it should be adequate.
Jim Meyering [Tue, 27 Apr 2010 14:32:40 +0000 (16:32 +0200)]
maint.mk: avoid side-effect in latest syntax-check
* top/maint.mk (sc_prohibit_always_true_header_tests): Rework not
to run commands via $(shell...), and hence to incur cost only when
the new rule is actually run.
Jim Meyering [Fri, 9 Apr 2010 17:07:57 +0000 (19:07 +0200)]
maint.mk: syntax-check: prohibit HAVE_<header>_H that are always true
Derive the list of guaranteed header names from gnulib/lib/*.in.h,
and use that to create a regexp used to detect all #if HAVE_..._H uses.
* top/maint.mk (sc_prohibit_always_true_header_tests): New rule.
(gl_assured_headers_, az_, AZ_): Define.
(gl_header_upper_case_or_, gl_have_header_regex_): Define.
Jim Meyering [Fri, 23 Apr 2010 09:38:35 +0000 (11:38 +0200)]
vc-list-files tests: convert to use init.sh
* tests/test-vc-list-files-cvs.sh: Invoke "$srcdir/init.sh" and
path_prepend_.
Use Exit, not exit.
Use skip_ rather than open coding it.
Remove trap set-up and compare definitions.
* tests/test-vc-list-files-git.sh: Likewise.
* modules/vc-list-files-tests (Files): Add tests/init.sh.
Use "git -h" for testing for supported options instead of "git --help".
The short-form option only shows a summary, and doesn't layout the full
man page, which is much faster and saves a dependency.
(We found out that git uses man in a build environment of
http://hydra.nixos.org/, which by default doesn't have man installed.)
Grep for the full option name in the summary, too.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Eric Blake [Fri, 16 Apr 2010 23:04:58 +0000 (17:04 -0600)]
test-stdbool: skip test that fails with Solaris CC
Solaris 9 CC has a bug; it allows (int)0.0 and (bool)0 in constant
expressions, but not (bool)0.0. Our replacement stdbool cannot
provide that guarantee of C99 for this particular compiler, but
since use of that feature causes compilation failure rather than
silent mis-compilation, we just skip the test.
* tests/test-stdbool.c (f): Skip test that causes compilation
error under buggy C++ compiler.
* lib/stdbool.in.h: Document the limitation.
* doc/posix-headers/stdbool.texi (stdbool.h): Likewise.
Eric Blake [Fri, 16 Apr 2010 20:08:15 +0000 (14:08 -0600)]
getopt: allow compilation with C++
A C++ compiler complains that REQUIRE_ORDER is unknown if it is
buried inside the struct.
* lib/getopt_int.h (__ordering): Hoist enum declaration outside
struct.
* lib/getopt.c (_getopt_internal_r): Use correct type.
Reported by Dagobert Michelson, via Joel E. Denny.
Eric Blake [Wed, 14 Apr 2010 19:03:38 +0000 (13:03 -0600)]
strtok_r: relax license to LGPLv2+
strtok_r borrows from glibc, which is LGPLv2+; besides, the
only major changes since 2007-10, when LGPLv3 became the default,
were in commit 5985805, to work around a glibc header bug.
* modules/strtok_r (License): Relax license.
Reported by Matthias Bolte.
Eric Blake [Fri, 9 Apr 2010 22:34:16 +0000 (16:34 -0600)]
getopt-gnu: match recent glibc fixes and posix ruling
The POSIX folks admitted that codifying the behavior of GNU
getopt on a leading '+' in optstring is worthwhile, for writing
programs such as env(1) even when POSIXLY_CORRECT is not defined.
http://austingroupbugs.net/view.php?id=191
However, the ruling is an enhancement request for the next
version of POSIX, and is not binding on platforms that comply
with POSIX 2008, so it should only be enforced for getopt-gnu.
* tests/test-getopt.h (test_getopt): Strengthen tests of leading
'+' handling, when requesting extensions.
* tests/test-getopt_long.h (test_getopt_long): Strengthen test of
'W;' handling.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Detect glibc 2.11 bug.
* doc/posix-functions/getopt.texi (getopt): Document this.
* doc/glibc-functions/getopt_long.texi (getopt_long): Likewise.
* doc/glibc-functions/getopt_long_only.texi (getopt_long_only):
Likewise.
git-version-gen: use "git update-index..." rather than "git status"
* build-aux/git-version-gen: Use git update-index --refresh, not
"git status". With some versions of git, "git status" would fail
to update the index and result in an unwarranted "-dirty" suffix.
Jim Meyering [Sun, 11 Apr 2010 11:35:33 +0000 (13:35 +0200)]
maint.mk: improve empty-line-at-EOF check
* top/maint.mk (sc_prohibit_empty_lines_at_EOF): Use Perl-based
solution, rather than tail+Perl-based one. The latter would read
a few kilobytes from the end of each file, and did not handle empty
files properly.
Jim Meyering [Sun, 11 Apr 2010 08:26:52 +0000 (10:26 +0200)]
maint.mk: print the elapsed time for each syntax-check rule
* top/maint.mk (sc_m_rules_): Save start time in a file.
(sc_z_rules_): New rules: remove temp file and print elapsed time.
(local-check): Interpose the .z rules