gnulib.git
12 years agoREADME-release: fix punctuation
Reuben Thomas [Sun, 18 Dec 2011 14:23:31 +0000 (15:23 +0100)]
README-release: fix punctuation

* top/README-release: s/:/./

12 years agobootstrap: correct the recent buildreq change
Jim Meyering [Sat, 17 Dec 2011 15:28:55 +0000 (16:28 +0100)]
bootstrap: correct the recent buildreq change

The 2011-12-07 commit, 39f5f1e4, omitted some '*'s, and thus
had no effect.
* build-aux/bootstrap (buildreq): Bracket each search term with
"*...*", so that the shell "case" statement works as intended.
Add comments.

12 years agobuild: let bootstrap resort to wget for downloading .po files
Bernhard Voelker [Mon, 5 Sep 2011 11:28:20 +0000 (13:28 +0200)]
build: let bootstrap resort to wget for downloading .po files

* build-aux/bootstrap (download_po_files): Fallback to wget when
downloading the .po files via rsync failed.  This is necessary to
bootstrap behind a strict firewall.

12 years ago* m4/stdint.m4 (gl_STDINT_H): Finish up previous change.
Paul Eggert [Fri, 16 Dec 2011 06:46:46 +0000 (22:46 -0800)]
* m4/stdint.m4 (gl_STDINT_H): Finish up previous change.

12 years agostdint: don't assume C++11 when compiling with g++
Paul Eggert [Thu, 15 Dec 2011 19:48:25 +0000 (11:48 -0800)]
stdint: don't assume C++11 when compiling with g++

Problem reported for glibc 2.14 and g++ by Alexander V. Lukyanov in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-12/msg00099.html>.
* m4/stdint.m4 (gl_STDINT_H): Don't go to extra work to make it
work also in C++ before C++11, as that improperly inhibits
generating a substitute stdint.h for that case.

12 years agoalloca: protect comment from gnulib-tool
Paul Eggert [Thu, 15 Dec 2011 19:10:23 +0000 (11:10 -0800)]
alloca: protect comment from gnulib-tool

* lib/alloca.c: Change "GCC version 2" to "GCC 2" in comment, so
that gnulib-tool doesn't think it's a license, and munge it to
say "GCC version 3".

12 years agoChangeLog: fix encoding typo
Paul Eggert [Thu, 15 Dec 2011 18:38:12 +0000 (10:38 -0800)]
ChangeLog: fix encoding typo

12 years agolocalcharset: Use an absolute path in TESTS_ENVIRONMENT.
Ludovic Courtès [Thu, 15 Dec 2011 00:10:48 +0000 (01:10 +0100)]
localcharset: Use an absolute path in TESTS_ENVIRONMENT.

* modules/localcharset (LOCALCHARSET_TESTS_ENVIRONMENT): Use
$(abs_top_builddir) instead of $(top_builddir).

12 years agostrftime-tests: also test nanoseconds
Alex Nelson [Wed, 14 Dec 2011 02:52:59 +0000 (18:52 -0800)]
strftime-tests: also test nanoseconds

The test-strftime program did not test the display of nanoseconds.  This
patch clarifies the expected output for a number of nanoseconds with
trailing zeroes.

* tests/test-strftime.c (T): Add a test of %N.
Signed-off-by: Alex Nelson <ajnelson@cs.ucsc.edu>
12 years agointtypes, stdint: add C++11 support
Paul Eggert [Tue, 13 Dec 2011 23:27:41 +0000 (15:27 -0800)]
inttypes, stdint: add C++11 support

C++11 says there's no need to define __STDC_CONSTANT_MACROS etc.
when including inttypes.h and stdint.h.  Support this change to
the standard.
* doc/posix-headers/inttypes.texi (inttypes.h):
* doc/posix-headers/stdint.texi (stdint.h): Document this.
* lib/inttypes.in.h (__STDC_FORMAT_MACROS) [! __cplusplus]:
Define if not defined already, for the benefit of pre-C++11 hosts.
Define the standard format macros (e.g., PRId8) always.
* lib/stdint.in.h (__STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS):
Likewise, if __cpluspus.  Define the standard constant and limit
macros (e.g., INT8_C, INT8_MAX) always.
* m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Do not define
GL_TRIGGER_STDC_LIMIT_MACROS or __STDC_LIMIT_MACROS; no longer needed.
* m4/stdint.m4 (gl_STDINT_H): Update comments about these macros.
* tests/test-inttypes.c (__STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS)
(__STDC_FORMAT_MACROS): Do not define, since we assume C++11 API now.
* tests/test-stdint.c (__STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS):
Likewise.

12 years agoFix ChangeLog typo in previous commit.
Paul Eggert [Tue, 13 Dec 2011 17:01:04 +0000 (09:01 -0800)]
Fix ChangeLog typo in previous commit.

12 years agononblocking tests: Fix test failure on Linux/MIPS.
Paul Eggert [Mon, 12 Dec 2011 16:13:33 +0000 (08:13 -0800)]
nonblocking tests: Fix test failure on Linux/MIPS.

Suggested by Prerna Saxena in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-12/msg00080.html>.
* tests/test-nonblocking-pipe.h (PIPE_DATA_BLOCK_SIZE) [Linux/PPC64]:
Set to 1100000.

12 years agoargmatch: don't hard-code `' when listing valid option arguments
Jim Meyering [Mon, 12 Dec 2011 09:57:17 +0000 (10:57 +0100)]
argmatch: don't hard-code `' when listing valid option arguments

* lib/argmatch.c (argmatch_valid): Don't hard-code `%s'.  Instead,
use the quote function to add quotes.  Use fputs rather than
fprintf for the format string with no format directive.

12 years agoautoupdate
Karl Berry [Sat, 10 Dec 2011 16:28:15 +0000 (08:28 -0800)]
autoupdate

12 years agoautoupdate
Karl Berry [Sat, 10 Dec 2011 16:23:45 +0000 (08:23 -0800)]
autoupdate

12 years agobootstrap: detect tools required by gnulib-tool
Eric Blake [Wed, 7 Dec 2011 16:51:21 +0000 (09:51 -0700)]
bootstrap: detect tools required by gnulib-tool

List tools needed by gnulib-tool, whether or not the project
also requires the tools in cfg.mk $buildreq.  In particular,
detect if the project uses gnulib-local diffs, in which case
patch is a prerequisite.

* build-aux/bootstrap (buildreq): Provide minimum implicit
dependencies.
* DEPENDENCIES: Mention patch as a prereq.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agosethostname: Port to Windows platforms.
Bruno Haible [Mon, 5 Dec 2011 02:46:40 +0000 (03:46 +0100)]
sethostname: Port to Windows platforms.

* lib/sethostname.c: Provide an alternate implementation for Windows
platforms.
* tests/test-sethostname2.c (geteuid): Redefine on Cygwin.
(main): Skip the test if sethostname() fails with EPERM. On Windows
platforms, don't check the result of gethostname().

2011-12-04  Bruno Haible  <bruno@clisp.org>

12 years agotests: Avoid spurious error message on platforms without mktemp program.
Bruno Haible [Mon, 5 Dec 2011 01:58:55 +0000 (02:58 +0100)]
tests: Avoid spurious error message on platforms without mktemp program.

* tests/init.sh (mktempd_): Run mktemp in a subcommand.

12 years agosethostname: Fix documentation.
Bruno Haible [Sun, 4 Dec 2011 14:47:27 +0000 (15:47 +0100)]
sethostname: Fix documentation.

* doc/glibc-functions/sethostname.texi: Move the Solaris problem to the
"not fixed" section.

12 years agognulib-tool: Verify that the License field is present and non-empty.
Bruno Haible [Sat, 3 Dec 2011 15:19:56 +0000 (16:19 +0100)]
gnulib-tool: Verify that the License field is present and non-empty.

* gnulib-tool (func_get_license_raw): New function, extracted from
func_get_license.
(func_get_license): Use it. Warn if the module is not a test module and
has no license.
Suggested by Jim Meyering.

12 years agosethostname tests: Fix link error on mingw.
Bruno Haible [Sat, 3 Dec 2011 14:57:00 +0000 (15:57 +0100)]
sethostname tests: Fix link error on mingw.

* tests/test-sethostname1.c: New file, extracted from
tests/test-sethostname.c.
* tests/test-sethostname2.c: New file, extracted from
tests/test-sethostname.c.
* tests/test-sethostname.c: Remove file.
* modules/sethostname-tests (Files): Add tests/test-sethostname1.c,
tests/test-sethostname2.c. Remove tests/test-sethostname.c.
(Depends-on): Add gethostname.
(Makefile.am): Compile both test-sethostname1 and test-sethostname2.
Link the latter with $(GETHOSTNAME_LIB).

12 years agosethostname tests: Fix compilation error on mingw.
Bruno Haible [Sat, 3 Dec 2011 14:28:47 +0000 (15:28 +0100)]
sethostname tests: Fix compilation error on mingw.

* tests/test-sethostname.c: Don't include <sys/types.h>.
(geteuid): Use a dummy value without uid_t.
* modules/sethostname-tests (Depends-on): Remove sys_types.

12 years agosethostname tests: Avoid a gcc warning.
Bruno Haible [Sat, 3 Dec 2011 14:13:59 +0000 (15:13 +0100)]
sethostname tests: Avoid a gcc warning.

* tests/test-sethostname.c (main): Remove an unused variable.

12 years agoTweak last commit.
Bruno Haible [Sat, 3 Dec 2011 13:50:45 +0000 (14:50 +0100)]
Tweak last commit.

* modules/sethostname-tests (Files): Sort by decreasing importance.
(configure.ac): Check for geteuid.
* tests/test-sethostname.c (main): Emit error messages to stderr. Skip
the test when there's nothing to test. Drop an unnecessary cast.
Improve an error message. Verify that the final sethostname() call
succeeds.

12 years agoAdd a test suite for the sethostname module.
Ben Walton [Sat, 3 Dec 2011 04:04:19 +0000 (23:04 -0500)]
Add a test suite for the sethostname module.

Provide a module that tests the functionality of sethostname().

* modules/sethostname-tests: New file.  A test program
for the sethostname module.
* tests/test-sethostname.c: Likewise.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
12 years agoTweak last commit.
Bruno Haible [Sat, 3 Dec 2011 13:22:09 +0000 (14:22 +0100)]
Tweak last commit.

* lib/unistd.in.h (sethostname): Keep declarations in alphabetic order.
Fix preprocessor directives indentation. Fix typos.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Keep alphabetic order.
* modules/unistd (Makefile): Likewise.

12 years agoIntegrate the sethostname module into unistd
Ben Walton [Sat, 3 Dec 2011 04:04:18 +0000 (23:04 -0500)]
Integrate the sethostname module into unistd

Ensure that sethostname is accounted for within the unistd module.

* lib/unistd.in.h: Integrate the SETHOSTNAME preprocessor handling
into the unistd.h header.
* m4/unistd_h.m4: Setup the autoconf handling for the SETHOSTNAME
preprocessor directives.
* modules/unistd: Setup the Makefile substitutions of the
SETHOSTNAME preprocessor directives.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
12 years agoTweak last commit.
Bruno Haible [Sat, 3 Dec 2011 13:09:14 +0000 (14:09 +0100)]
Tweak last commit.

* lib/sethostname.c: Don't include <string.h>.
(sethostname): No need to copy the argument string to the stack. Don't
call clearerr. Preserve errno when fprintf failed.
* m4/sethostname.m4 (gl_FUNC_SETHOSTNAME): Comment about HOST_NAME_MAX.
Don't invoke AC_REPLACE_FUNCS.
* modules/sethostname (Link): Remove empty section.
* doc/glibc-functions/sethostname.texi: Gnulib does not fix the ENOSYS
failure problem.

12 years agoAdd a new sethostname module
Ben Walton [Sat, 3 Dec 2011 04:04:17 +0000 (23:04 -0500)]
Add a new sethostname module

Define sethostname on platforms that do not provide the declaration.
Provide a function for platforms that lack it.  The general handling
of the provided function is to simply return -1 and set errno to
ENOSYS.  A specific handler is provided for Minix.

* lib/sethostname.c (sethostname): New file.  Provide sethostname
for systems that lack it.
* m4/sethostname.m4 (gl_FUNC_SETHOSTNAME): New file.  Detection of
sethostname declaration and function.
* modules/sethostname: New file.  Define the sethostname module.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
12 years agoTweak last commit.
Bruno Haible [Sat, 3 Dec 2011 12:27:29 +0000 (13:27 +0100)]
Tweak last commit.

* m4/gethostname.m4 (gl_PREREQ_HOST_NAME_MAX): Trim blank line.

12 years agoSplit the HOST_NAME_MAX detection into a separate m4 macro
Ben Walton [Sat, 3 Dec 2011 04:04:16 +0000 (23:04 -0500)]
Split the HOST_NAME_MAX detection into a separate m4 macro

The sethostname module will rely on this code too, so make it a
separate function.

* m4/gethostname.m4 (gl_PREREQ_HOST_NAME_MAX): Make this a separate
macro so it can be used by the pending sethostname module.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
12 years agoFix module descriptions syntax.
Bruno Haible [Sat, 3 Dec 2011 12:09:58 +0000 (13:09 +0100)]
Fix module descriptions syntax.

* modules/argv-iter (License): Fix syntax.
* modules/di-set (License): Likewise.
* modules/ino-map (License): Likewise.
Reported by Stefano Lattarini <stefano.lattarini@gmail.com>.

12 years agostdalign: port to Clang 3.0
Paul Eggert [Fri, 2 Dec 2011 09:34:53 +0000 (01:34 -0800)]
stdalign: port to Clang 3.0

Problem reported by Simon Josefsson in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-12/msg00005.html>.
* doc/posix-headers/stdalign.texi (stdalign.h): Mention Clang 3.0,
which has <stdalign.h> but which does not define alignof.
* m4/stdalign.m4 (gl_STDALIGN_H): Check for Clang 3.0's problem.

12 years agomktempd: silence dd usage
Eric Blake [Thu, 1 Dec 2011 20:58:28 +0000 (13:58 -0700)]
mktempd: silence dd usage

When running a testsuite on FreeBSD, I saw a lot of:

1+ records in
0+1 records out
10 bytes transferred in 0.000063 secs (158875 bytes/sec)

literring the testsuite, and traced it to the fact that we
were silencing one, but not the other, dd usage in our fallback.

* build-aux/mktempd (rand_bytes): Silence dd.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agomanywarnings: Don't mention gcc version in docstring.
Simon Josefsson [Wed, 30 Nov 2011 10:59:31 +0000 (11:59 +0100)]
manywarnings: Don't mention gcc version in docstring.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Doc fix.  Suggested by
Jim Meyering <meyering@redhat.com>.

12 years agohash: mark a few floating point constants with "f" suffix
Jim Meyering [Wed, 30 Nov 2011 08:35:00 +0000 (09:35 +0100)]
hash: mark a few floating point constants with "f" suffix

* lib/hash.c (DEFAULT_GROWTH_THRESHOLD, DEFAULT_GROWTH_FACTOR)
(DEFAULT_SHRINK_THRESHOLD, DEFAULT_SHRINK_FACTOR): Mark literal
floating point constants with "f", since they're destined to be
saved/used as "float"s.

12 years agofloat tests: Correct and re-enable assertion about LDBL_MIN_EXP.
Paolo Bonzini [Wed, 30 Nov 2011 00:58:54 +0000 (01:58 +0100)]
float tests: Correct and re-enable assertion about LDBL_MIN_EXP.

* tests/test-float.c (test_long_double): Correct and re-enable the
assertion about LDBL_MIN_EXP that was disabled on 2011-08-31.

12 years agoAvoid subtracting two pointers that don't point into the same block.
Matthew Wala [Wed, 30 Nov 2011 00:44:15 +0000 (01:44 +0100)]
Avoid subtracting two pointers that don't point into the same block.

* lib/argp-help.c (hol_append): Reorder pointer subtractions so that
only pointers into the same memory block are subtracted. We cannot
assume that sizeof (ptrdiff_t) == sizeof (void *).

12 years agomaint.mk: add syntax check for use of compare from init.sh
Eric Blake [Tue, 29 Nov 2011 21:37:14 +0000 (14:37 -0700)]
maint.mk: add syntax check for use of compare from init.sh

Comparing expected against actual gives more consistent diff listings
when reporting test failures.  Enforce this idiom on test files
that use init.sh, and allow projects to recognize an alternate
pattern for recognizing tests scripts that use a compare function.

* top/maint.mk (sc_prohibit_reversed_compare_failure): New rule,
moved here from coreutils.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agomanywarnings: drop -Wunsuffixed-float-constants
Eric Blake [Tue, 29 Nov 2011 22:01:22 +0000 (15:01 -0700)]
manywarnings: drop -Wunsuffixed-float-constants

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): C99 does not allow
'1.0D', which is the only way to silence this warning for 'double'.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agohash: mark compute_bucket_size with the pure attribute
Jim Meyering [Tue, 29 Nov 2011 13:25:56 +0000 (14:25 +0100)]
hash: mark compute_bucket_size with the pure attribute

* lib/hash.c (compute_bucket_size): Use _GL_ATTRIBUTE_PURE.

12 years agoquotearg, propername: correct pragma guard expression
Jim Meyering [Tue, 29 Nov 2011 09:09:41 +0000 (10:09 +0100)]
quotearg, propername: correct pragma guard expression

* lib/quotearg.c: Enable pragma for gcc-4.6 and newer, not 4.3 and newer.
* lib/propername.c: Likewise.  Reported by Bernhard Voelker.

12 years agopropername: do not mark proper_name with the const attribute
Jim Meyering [Mon, 28 Nov 2011 09:24:04 +0000 (10:24 +0100)]
propername: do not mark proper_name with the const attribute

* lib/propername.h (proper_name): Do *not* mark as _GL_ATTRIBUTE_CONST,
since it examines data pointed to by its parameter.
* lib/propername.c (proper_name): Instead, add a pragma to suppress
the suggestion from -Wsuggest-attribute=const.

12 years agopropername: mark one more function as const
Jim Meyering [Mon, 28 Nov 2011 08:39:34 +0000 (09:39 +0100)]
propername: mark one more function as const

* lib/propername.h (proper_name): Mark as _GL_ATTRIBUTE_CONST.

12 years agomark functions with const and pure attributes
Jim Meyering [Thu, 2 Jun 2011 08:05:59 +0000 (10:05 +0200)]
mark functions with const and pure attributes

Mark functions per suggestions from gcc-4.6 when using these options:
-Wsuggest-attribute=pure -Wsuggest-attribute=const.
Use gnulib's _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST macros.
Follow these guidelines: when possible, apply the attribute to
an extern declaration, not to its definition.  Apply it to the
definition only when the definition is static.
* lib/argmatch.h (argmatch, argmatch_to_argument): Mark.
* lib/argv-iter.h (argv_iter_n_args): Likewise.
* lib/base64.h (isbase64): Likewise.
* lib/basename-lgpl.c (last_component, base_len): Likewise.
* lib/c-ctype.h (c_isascii, c_isalnum, c_isalpha): Likewise.
(c_isblank, c_iscntrl, c_isdigit, c_islower, c_isgraph): Likewise.
(c_isprint, c_ispunct, c_isspace, c_isupper, c_isxdigit): Likewise.
(c_tolower, c_toupper): Likewise.
* lib/c-strcase.h (c_strcasecmp, c_strncasecmp): Likewise.
* lib/chdir-long.c (find_non_slash): Likewise.
* lib/dirname.h (base_len, dir_len, last_component): Likewise.
* lib/exclude.h (fnmatch_pattern_has_wildcards): Likewise.
* lib/file-type.h (file_type): Likewise.
* lib/filenamecat-lgpl.c (longest_relative_suffix): Likewise.
* lib/filevercmp.c (verrevcmp): Likewise.
* lib/freadahead.h (freadahead): Likewise.
* lib/fts.c (fts_maxarglen): Likewise.
* lib/hash-pjw.h (hash_pjw): Likewise.
* lib/hash-triple.h (triple_hash_no_name, triple_compare_ino_str):
* lib/hash.c (is_prime, next_prime): Likewise.
* lib/hash.c (hash_get_n_buckets, hash_get_n_buckets_used): Likewise.
(hash_get_n_entries, hash_get_max_bucket_length): Likewise.
(hash_table_ok, hash_get_first, hash_string): Likewise.
(compute_bucket_size): Likewise.
* lib/i-ring.h (i_ring_empty): Likewise.
* lib/isnan.c (isnanl): Likewise.
* lib/math.h (isnanl, rpl_isnanl): Likewise.
* lib/memcasecmp.h (memcasecmp): Likewise.
* lib/memchr2.h (memchr2): Likewise.
* lib/memcmp2.h (memcmp2): Likewise.
* lib/parse-datetime.y (lookup_zone): Likewise.
* lib/sockets.h (gl_sockets_startup, gl_sockets_cleanup)
[!WINDOWS_SOCKETS]: Likewise.
* lib/strnlen1.h (strnlen1): Likewise.
* lib/uniwidth.in.h (uc_width): Likewise, but since this is installed
as a public header by libunistring, it cannot depend on the macro
definitions of gnulib-common.m4, so open-code the __attribute__...
* lib/quotearg.c: Add pragma to avoid unwarranted suggestion from
gcc's -Wsuggest-attribute=pure for quoting_options_from_style.
(quoting_options_from_style): Add a comment.
* lib/propername.h (proper_name): Add a comment.

12 years agoRemove unused macros from !_LIBC code in glibc-borrowed files.
Bruno Haible [Mon, 28 Nov 2011 00:09:32 +0000 (01:09 +0100)]
Remove unused macros from !_LIBC code in glibc-borrowed files.

* lib/fnmatch.c (STRCOLL): Remove macro.
* lib/fnmatch_loop.c (STRCOLL): Remove undef.
* lib/glob.c (__stat, __readdir64): Remove macros.
* lib/tempname.c (__open64, __xstat64): Remove macros.
Suggested by Paul Eggert.

12 years agogetcwd: Fix link error on MSVC 9.
Bruno Haible [Sun, 27 Nov 2011 23:44:07 +0000 (00:44 +0100)]
getcwd: Fix link error on MSVC 9.

* modules/getcwd (Depends-on): Add readdir, rewinddir.

12 years agoDon't set REPLACE_FOO to 1 if HAVE_FOO is 0.
Bruno Haible [Sun, 27 Nov 2011 23:43:01 +0000 (00:43 +0100)]
Don't set REPLACE_FOO to 1 if HAVE_FOO is 0.

* m4/opendir.m4 (gl_FUNC_OPENDIR): Don't set REPLACE_OPENDIR to 1 if
HAVE_OPENDIR is 0.
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Don't set REPLACE_CLOSEDIR to 1 if
HAVE_CLOSEDIR is 0.
* m4/dup2.m4 (gl_FUNC_DUP2): Don't set REPLACE_DUP2 to 1 if HAVE_DUP2
is 0.
* m4/dup3.m4 (gl_FUNC_DUP3): Update comments.

12 years agogetcwd: Fix bug from 2011-08-17.
Bruno Haible [Sun, 27 Nov 2011 23:04:12 +0000 (00:04 +0100)]
getcwd: Fix bug from 2011-08-17.

* m4/getcwd.m4 (gl_FUNC_GETCWD): Set REPLACE_GETCWD to 1 only on
platforms that need it.
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Consider a return
code of 4 to be a failure, not a success. This ensures that
REPLACE_GETCWD becomes 1 on OpenBSD 4.9 and NetBSD 5.1.

12 years agobinary-io tests: Avoid test failure on mingw when libtool is used.
Bruno Haible [Sun, 27 Nov 2011 14:54:08 +0000 (15:54 +0100)]
binary-io tests: Avoid test failure on mingw when libtool is used.

* tests/test-binary-io.c (main): Don't remove t-bin-out2.tmp here.
Don't verify the size of t-bin-out1.tmp here.
* tests/test-binary-io.sh: Verify it here.
Reported by Simon Josefsson.

12 years agoFix conflict between two instantiations of module 'unistd'.
Bruno Haible [Sat, 26 Nov 2011 20:08:25 +0000 (21:08 +0100)]
Fix conflict between two instantiations of module 'unistd'.

* gnulib-tool (func_emit_autoconf_snippet): Substitute
${include_guard_prefix} also in the autoconf snippet.
* m4/getopt.m4 (gl_FUNC_GETOPT_POSIX): Don't set GNULIB_UNISTD_H_GETOPT.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize
GNULIB_UNISTD_H_GETOPT.
* modules/getopt-posix (configure.ac): Set the
GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT variable.
* modules/getopt-gnu (configure.ac): Likewise.
* modules/unistd (Makefile.am): Change the substitution value of
GNULIB_UNISTD_H_GETOPT to depend on the include guard prefix.
Reported by Simon Josefsson.

12 years agopagealign_alloc: Doc and comments.
Bruno Haible [Fri, 25 Nov 2011 23:24:43 +0000 (00:24 +0100)]
pagealign_alloc: Doc and comments.

* doc/posix-functions/posix_memalign.texi: Refer to the pagealign_alloc
module.
* lib/pagealign_alloc.c (pagealign_alloc): Add comment.

12 years agotest-update-copyright.sh: avoid false-positive failure
Jim Meyering [Fri, 25 Nov 2011 09:03:49 +0000 (10:03 +0100)]
test-update-copyright.sh: avoid false-positive failure

* tests/test-update-copyright.sh: Use $TMP.? (not $TMP.*), to work
around false positive failure on Cygwin/Windows.  The latter was
matching erroneously-created files with names like
update-copyright.test-ex.4.bak.  Reported by Simon Josefsson.

12 years agovalgrind-tests.m4: Avoid breakage if valgrind on bash fails.
Simon Josefsson [Thu, 24 Nov 2011 23:20:17 +0000 (00:20 +0100)]
valgrind-tests.m4: Avoid breakage if valgrind on bash fails.

* m4/valgrind-tests.m4: Check that the parameters that will be
used works, not just a subset of them.  Reported by Bruno Haible
<bruno@clisp.org>.

12 years agotest-stdalign.c: comment out long double tests
Jim Meyering [Thu, 24 Nov 2011 21:04:32 +0000 (22:04 +0100)]
test-stdalign.c: comment out long double tests

* tests/test-stdalign.c: Don't try to reduce alignment of long double
variables.  That provokes errors like this from gcc-4.7.0 20111124:
error: '_Alignas' specifiers cannot reduce alignment of \
'static_longdouble_alignas'.

12 years agoinit.sh: make "compare /dev/null FILE" output more readable
Jim Meyering [Tue, 22 Nov 2011 13:51:45 +0000 (14:51 +0100)]
init.sh: make "compare /dev/null FILE" output more readable

* tests/init.sh (compare_): Document the preferred order of arguments.
(emit_diff_u_header_): New function.
(compare_dev_null_): Emit a simulated diff, rather than just the
contents of the unexpected file.  Suggestion from Bruno Haible.

12 years agoinit.sh: work around OSF/1 5.1's mishandling of /dev/null
Jim Meyering [Mon, 21 Nov 2011 20:50:23 +0000 (21:50 +0100)]
init.sh: work around OSF/1 5.1's mishandling of /dev/null

* tests/init.sh: Make our compare function slightly more portable.
Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020
Much improved by Eric Blake.

12 years agognulib-common: Silence warnings against config.h code.
Simon Josefsson [Mon, 21 Nov 2011 13:18:24 +0000 (14:18 +0100)]
gnulib-common: Silence warnings against config.h code.

* m4/gnulib-common.m4 (_Noreturn): Check that _MSC_VER is defined
before using it, in code that ends up in config.h.

12 years agoautoupdate
Karl Berry [Mon, 21 Nov 2011 13:54:01 +0000 (05:54 -0800)]
autoupdate

12 years agogetcwd: Work around getcwd bug on AIX 5..7.
Bruno Haible [Sun, 20 Nov 2011 23:56:11 +0000 (00:56 +0100)]
getcwd: Work around getcwd bug on AIX 5..7.

* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Require
AC_CANONICAL_HOST. Assign exit code 31 to the bug seen on AIX 5.1..7.1.
Use a different value for gl_cv_func_getcwd_path_max. Move the
definition of HAVE_PARTLY_WORKING_GETCWD from here...
* m4/getcwd.m4 (gl_FUNC_GETCWD): ... to here. Invoke
gl_FUNC_GETCWD_PATH_MAX also when $gl_cv_func_getcwd_null is 'no'.
Define HAVE_MINIMALLY_WORKING_GETCWD.
* lib/getcwd.c (__getcwd): Don't use the system's getcwd on platforms
where it is not even minimally working, that is, on AIX.
* tests/test-getcwd.c (test_long_name): Distinguish the same cases as
m4/getcwd-path-max.m4.
(main): Update exit code computation.
* doc/posix-functions/getcwd.texi: Mention list of platforms where
getcwd does not handle long file names.

12 years agogetcwd: Fix bug from 2009-09-10.
Bruno Haible [Sun, 20 Nov 2011 22:28:01 +0000 (23:28 +0100)]
getcwd: Fix bug from 2009-09-10.

* m4/getcwd.m4 (gl_FUNC_GETCWD): Treat "guessing yes" like "yes", not
like "no".

12 years agomanywarnings: More warnings.
Simon Josefsson [Sun, 20 Nov 2011 22:08:31 +0000 (23:08 +0100)]
manywarnings: More warnings.

* m4/manywarnings.m4: Add more warnings from gcc 4.6.2.

12 years agofma tests: Avoid shadowing local variables.
Bruno Haible [Sun, 20 Nov 2011 16:43:49 +0000 (17:43 +0100)]
fma tests: Avoid shadowing local variables.

* tests/test-fma2.h (test_function): Reduce scope of x, y, z, result,
expected.

12 years agocopysignf tests: Fix.
Bruno Haible [Sun, 20 Nov 2011 16:38:19 +0000 (17:38 +0100)]
copysignf tests: Fix.

* tests/test-copysignf.c: Fix signature check.

12 years agofma: Remove unused code.
Bruno Haible [Sun, 20 Nov 2011 14:52:36 +0000 (15:52 +0100)]
fma: Remove unused code.

* lib/fma.c (DECL_ROUNDING, BEGIN_ROUNDING, END_ROUNDING): Remove
unused macros.

12 years agosethostname: Fix doc about AIX.
Bruno Haible [Sun, 20 Nov 2011 14:12:32 +0000 (15:12 +0100)]
sethostname: Fix doc about AIX.

* doc/glibc-functions/sethostname.texi: Drop mention that AIX 5.1 lacks
sethostname; it has it.

12 years agosethostname: Mention more portability problems.
Bruno Haible [Sun, 20 Nov 2011 13:21:07 +0000 (14:21 +0100)]
sethostname: Mention more portability problems.

* doc/glibc-functions/sethostname.texi: Mention the missing declaration
problem.
Reported by Ben Walton <bwalton@artsci.utoronto.ca>.

12 years agoDepend on module fcntl-h when AT_FDCWD is used.
Bruno Haible [Sat, 19 Nov 2011 20:07:36 +0000 (21:07 +0100)]
Depend on module fcntl-h when AT_FDCWD is used.

* modules/utimens (Depends-on): Add fcntl-h.
* modules/areadlinkat (Depends-on): Likewise.
* modules/areadlinkat-with-size (Depends-on): Likewise.
* modules/faccessat (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fchownat (Depends-on): Likewise.
* modules/getcwd (Depends-on): Likewise.
* modules/mkdirat (Depends-on): Likewise.
* modules/mkfifoat (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/symlinkat (Depends-on): Likewise.
* modules/dup2-tests (Depends-on): Likewise.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.

12 years agoeuidaccess: Update a comment.
Bruno Haible [Sat, 19 Nov 2011 19:55:04 +0000 (20:55 +0100)]
euidaccess: Update a comment.

* lib/euidaccess.c: Update comment about platforms with faccessat.

12 years agoopenat: Fix file list.
Bruno Haible [Sat, 19 Nov 2011 19:52:52 +0000 (20:52 +0100)]
openat: Fix file list.

* modules/openat (Files): Remove lib/at-func.c.

12 years agofstatat: Simplify.
Bruno Haible [Sat, 19 Nov 2011 18:08:02 +0000 (19:08 +0100)]
fstatat: Simplify.

* lib/fstatat.c (AT_FUNC_NAME): Define as fstatat. On platforms where
gnulib should define rpl_fstatat, there is a
"#define fstatat rpl_fstatat" in <sys/stat.h>.

12 years agoEnsure 'inline' can be used in tests/test-utimens-common.h.
Bruno Haible [Sat, 19 Nov 2011 16:29:36 +0000 (17:29 +0100)]
Ensure 'inline' can be used in tests/test-utimens-common.h.

* modules/fdutimensat-tests (configure.ac): Require AC_C_INLINE.
* modules/futimens-tests (configure.ac): Likewise.
* modules/utimens-tests (configure.ac): Likewise.
* modules/utimensat-tests (configure.ac): Likewise.

12 years agohash: Don't refer to deprecated interfaces.
Simon Josefsson [Sat, 19 Nov 2011 11:43:48 +0000 (12:43 +0100)]
hash: Don't refer to deprecated interfaces.

* lib/hash.c (hash_insert): Use hash_insert_if_absent,
not hash_insert0.
(hash_insert_if_absent): Doc fix.

12 years agoreadline: Check for readline/history.h.
Simon Josefsson [Sat, 19 Nov 2011 07:35:40 +0000 (08:35 +0100)]
readline: Check for readline/history.h.

* m4/readline.m4 (gl_FUNC_READLINE): Check for readline/history.h.

12 years agotest-getcwd: disambiguate exit status
Paul Eggert [Sat, 19 Nov 2011 03:49:47 +0000 (19:49 -0800)]
test-getcwd: disambiguate exit status

* tests/test-getcwd.c (test_long_name): Return 0..7.
(main): Exit with an unambiguous exit status.  The old
code yielded a mysterious mixture of two failure codes.

12 years agofstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8
Paul Eggert [Sat, 19 Nov 2011 02:01:44 +0000 (18:01 -0800)]
fstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8

* lib/fstatat.c (AT_FUNC_NAME): Use HAVE_FSTAT, not
HAVE_WORKING_FSTATAT_ZERO_FLAG, to decide whether to define
rpl_fstatat or fstatat.  This should fix the other problem
reported by Kai Habel in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>.
A similar problem was reported for OpenBSD 4.6 by Mats Erik Andersson
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00239.html>
and I reproduced it on a Solaris 8 host we still have in production.

12 years agohash: deprecate poorly-named hash_insert0: use hash_insert_if_absent
Jim Meyering [Fri, 18 Nov 2011 11:09:16 +0000 (12:09 +0100)]
hash: deprecate poorly-named hash_insert0: use hash_insert_if_absent

* lib/hash.c (hash_insert_if_absent): Rename from hash_insert0.
Add a sentence to the comment.
(hash_insert0): New function that simply calls hash_insert_if_absent.
* lib/hash.h (hash_insert_if_absent): Declare it.
(hash_insert0): Add deprecation attribute.
(_GL_ATTRIBUTE_DEPRECATED): Define.
* lib/di-set.c (di_set_insert): Use hash_insert_if_absent,
not hash_insert0.
* NEWS: Mention it, even though it's not really an incompatible change
Prompted by a question from Matthew Booth <mbooth@redhat.com>.

12 years agoopenat: avoid compilation failure due to lack of <errno.h> inclusion
Dagobert Michelsen [Fri, 18 Nov 2011 13:02:51 +0000 (14:02 +0100)]
openat: avoid compilation failure due to lack of <errno.h> inclusion

* lib/openat.c: Include <errno.h>.

12 years ago* modules/getcwd (Depends-on): Add fdopendir.
Paul Eggert [Fri, 18 Nov 2011 07:32:50 +0000 (23:32 -0800)]
* modules/getcwd (Depends-on): Add fdopendir.

This fixes one of the two problems reported by Kai Habel in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>.

12 years agomodules/crypto/gc-*: simplify dependencies and fix stdalign.h bug
Paul Eggert [Fri, 18 Nov 2011 06:08:54 +0000 (22:08 -0800)]
modules/crypto/gc-*: simplify dependencies and fix stdalign.h bug

stdalign problem reported by Ian Beckwith in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00238.html>.
* modules/crypto/gc-arcfour (Depends-on):
Depend conditionally on crypto/arcfour.
* modules/crypto/gc-arctwo (Depends-on):
Depend conditionally on crypto/arctwo.
* modules/crypto/gc-des (Depends-on):
Depend conditionally on crypto/des.
* modules/crypto/gc-hmac-md5 (Depends-on):
Depend conditionally on crypto/hmac-md5.
* modules/crypto/gc-hmac-sha1 (Depends-on):
Depend conditionally on crypto/hmac-sha1.
* modules/crypto/gc-md2 (Depends-on): Remove stdint, minmax.
* modules/crypto/gc-md4 (Depends-on):
Depend conditionally on crypto/md4.
* modules/crypto/gc-md5 (Depends-on):
Depend conditionally on crypto/md5.
* modules/crypto/gc-rijndael (Depends-on):
Depend conditionally on crypto/rijndael.
* modules/crypto/gc-sha1 (Depends-on):
Depend conditionally on crypto/sha1.
* modules/crypto/gc-arcfour:
* modules/crypto/gc-arctwo:
* modules/crypto/gc-des:
* modules/crypto/gc-hmac-md5:
* modules/crypto/gc-hmac-sha1:
* modules/crypto/gc-md2:
* modules/crypto/gc-md4:
* modules/crypto/gc-md5:
* modules/crypto/gc-rijndael:
* modules/crypto/gc-sha1:
(Files, Depends-on, configure.ac): Remove now-unnecessary stuff,
now that the conditional dependencies do the work for us.

12 years agotests: factor out st_ctime-comparison code (a dozen uses)
Jim Meyering [Thu, 17 Nov 2011 14:28:55 +0000 (15:28 +0100)]
tests: factor out st_ctime-comparison code (a dozen uses)

* tests/test-utimens-common.h (ctime_compare): Define.
* tests/test-futimens.h (test_futimens): Replace open-coded equivalent.
* tests/test-lutimens.h (test_lutimens): Likewise.
* tests/test-utimens.h (test_utimens): Likewise.

12 years agotest-getcwd: don't leave behind a confdir3/ directory upon interrupt
Jim Meyering [Thu, 17 Nov 2011 11:27:06 +0000 (12:27 +0100)]
test-getcwd: don't leave behind a confdir3/ directory upon interrupt

Invoke the test program via an init.sh-using wrapper.
* tests/test-getcwd.sh: New file.
* modules/getcwd-tests (Files): Add it.
(Makefile.am) [TESTS]: Invoke the shell script wrapper.

12 years agogitlog-to-changelog: support multi-author commits.
Gary V. Vaughan [Tue, 1 Nov 2011 10:58:37 +0000 (17:58 +0700)]
gitlog-to-changelog: support multi-author commits.

The FSF cares about keeping track of all authors of patches to its
projects, but Git doesn't provide obvious support for multi-author
changesets. Consensus seems to be forming around the use of extra
Signed-off-by inspired lines in the log message formatted as
`Co-authored-by: A U Thor <email@example.com>' for round-tripping
multi-author commits between version control systems.
* gitlog-to-changelog: Extract `Co-authored-by:' lines from the git
log message and output in standard ChangeLog multi-author format.
Reported by Peter Rosin <peda@lysator.liu.se>

12 years agoFix some modules' file list.
Bruno Haible [Wed, 16 Nov 2011 02:08:28 +0000 (03:08 +0100)]
Fix some modules' file list.

* modules/fstatat (Files): Add m4/lstat.m4.
* modules/openat (Files): Likewise.
* modules/unlinkat (Files): Likewise.

12 years agomaint.mk: fix tight-scope.mk generation in VPATH builds.
Gary V. Vaughan [Tue, 15 Nov 2011 10:39:44 +0000 (17:39 +0700)]
maint.mk: fix tight-scope.mk generation in VPATH builds.

* top/maint.mk (tight-scope.mk): Make sure to prefix file
reference with $(srcdir) so that the file is found correctly even
when running `make syntax-check' in a VPATH build.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
12 years agoSilence successful tests that use 'compare' on AIX, HP-UX, Solaris.
Bruno Haible [Sun, 13 Nov 2011 20:20:59 +0000 (21:20 +0100)]
Silence successful tests that use 'compare' on AIX, HP-UX, Solaris.

* tests/init.sh (compare): Remove "No differences encountered" or
synonymous output from the 'diff' program.

12 years agoMakefile: Tweak indentation.
Bruno Haible [Sun, 13 Nov 2011 18:22:08 +0000 (19:22 +0100)]
Makefile: Tweak indentation.

* Makefile: Use tab as first character in every line that contains rule
commands.

12 years agoSyntax check for copyright statements.
Bruno Haible [Sun, 13 Nov 2011 18:14:12 +0000 (19:14 +0100)]
Syntax check for copyright statements.

* check-copyright: New file.
* Makefile (sc_check_copyright): New rule.

12 years agoFix for last commit.
Simon Josefsson [Sun, 13 Nov 2011 13:46:48 +0000 (14:46 +0100)]
Fix for last commit.

12 years agogit-version-gen: Add --prefix.
Simon Josefsson [Sun, 13 Nov 2011 13:43:35 +0000 (14:43 +0100)]
git-version-gen: Add --prefix.

* build-aux/git-version-gen: Add --prefix to configure the tag
match string.

12 years agogit-version: Improve command line handling.
Simon Josefsson [Sun, 13 Nov 2011 10:07:41 +0000 (11:07 +0100)]
git-version: Improve command line handling.

* build-aux/git-version-gen: Add --help and --version.

12 years agorevamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering [Sat, 12 Nov 2011 16:12:59 +0000 (17:12 +0100)]
revamp the other test-exclude?.sh scripts to use init.sh, too

* tests/test-exclude1.sh: Use init.sh.
* tests/test-exclude2.sh: Likewise.
* tests/test-exclude3.sh: Likewise.
* tests/test-exclude4.sh: Likewise.
* tests/test-exclude5.sh: Likewise.
* tests/test-exclude6.sh: Likewise.
* tests/test-exclude7.sh: Likewise.
* tests/test-exclude8.sh: Likewise.
* modules/exclude-tests (Files): List init.sh.

12 years agotest-exclude2.sh, test-exclude5.sh: fail if test-exclude fails
Jim Meyering [Sat, 12 Nov 2011 15:48:09 +0000 (16:48 +0100)]
test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails

These shell scripts ignored failure of the binary test-exclude,
so making the latter return 77 didn't cause them to be skipped.
* tests/test-exclude5.sh: Exit with test-exclude's error status
when that program fails.  Revamp to use init.sh.
* tests/test-exclude2.sh: Likewise.

12 years agotest-exclude: fix a typo
Jim Meyering [Sat, 12 Nov 2011 15:44:59 +0000 (16:44 +0100)]
test-exclude: fix a typo

* tests/test-exclude.c (main): Test for "leading_dir", not "leading-dir".

12 years agoautoupdate
Karl Berry [Sat, 12 Nov 2011 00:25:33 +0000 (16:25 -0800)]
autoupdate

12 years agoobstack: Fix compilation error on MSVC 9.
Bruno Haible [Fri, 11 Nov 2011 20:52:32 +0000 (21:52 +0100)]
obstack: Fix compilation error on MSVC 9.

* lib/obstack.c (print_and_abort): Declare with _Noreturn specifier.

12 years agotest-exclude: skip tests rather than failing on deficient systems
Jim Meyering [Fri, 11 Nov 2011 13:37:59 +0000 (14:37 +0100)]
test-exclude: skip tests rather than failing on deficient systems

* tests/test-exclude.c (main): Skip tests that use FNM_CASEFOLD
and FNM_LEADING_DIR on systems that lack the definitions.  This affects
at least Solaris 9.  Reported and diagnosed by Dagobert Michelsen in
http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3947/focus=3950

12 years agoptsname_r test: Avoid gcc warning on glibc systems.
Bruno Haible [Thu, 10 Nov 2011 12:56:40 +0000 (13:56 +0100)]
ptsname_r test: Avoid gcc warning on glibc systems.

* tests/test-ptsname_r.c (null_ptr): New function.
(test_errors): Use it.

12 years agoptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible [Thu, 10 Nov 2011 12:48:16 +0000 (13:48 +0100)]
ptsname_r: Avoid compilation error on OSF/1 5.1.

* lib/stdlib.in.h (ptsname_r): Override if REPLACE_PTSNAME_R is 1.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_PTSNAME_R.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Set REPLACE_PTSNAME_R if the
function is not declared or incompatibly declared.
* modules/stdlib (Makefile.am): Substitute REPLACE_PTSNAME_R.
* modules/ptsname_r (Depends-on, configure.ac): Update.
* doc/glibc-functions/ptsname_r.texi: Mention the OSF/1 problems.

12 years agofstatat: Make cross-compilation guess succeed everywhere except on AIX.
Bruno Haible [Thu, 10 Nov 2011 11:31:22 +0000 (12:31 +0100)]
fstatat: Make cross-compilation guess succeed everywhere except on AIX.

* m4/fstatat.m4 (gl_FUNC_FSTATAT): Require AC_CANONICAL_HOST.
When cross-compiling, guess yes on all platforms except AIX.
Reported by Ludovic Courtès <ludo@gnu.org>.