gnulib.git
12 years agocanonicalize: only stat() when required
Pádraig Brady [Sat, 31 Dec 2011 11:03:58 +0000 (11:03 +0000)]
canonicalize: only stat() when required

* lib/canonicalize.c (canonicalize_filename_mode):
Avoid calling l?stat() when both CAN_MISSING,
and CAN_NOLINKS are set, as then we neither need
to resolve symlinks or test component existence.

12 years agodoc: cover st_ino issues once; add OpenVMS etc.
Paul Eggert [Sat, 31 Dec 2011 21:38:25 +0000 (13:38 -0800)]
doc: cover st_ino issues once; add OpenVMS etc.

* doc/posix-functions/stat.texi (stat):
* doc/posix-functions/lstat.texi (lstat):
* doc/posix-functions/fstatat.texi (fstatat):
* doc/posix-functions/fstat.texi (fstat):
Move general 'struct stat' stuff to sys_stat.texi,
leaving behind a pointer.
* doc/posix-headers/sys_stat.texi (sys/stat.h):
Merge duplicate info about 'struct stat' problems into here.
Mention issues with OpenVMS, GNU/Linux NFS, NetApp, ClearCase,
and suggest partial workarounds.

12 years agosame-inode: port to OpenVMS
Paul Eggert [Sat, 31 Dec 2011 21:19:53 +0000 (13:19 -0800)]
same-inode: port to OpenVMS

* lib/same-inode.h (SAME_INODE): Port to OpenVMS by checking all
three st_ino values.

12 years agocanonicalize: fix references to stat() and lstat()
Pádraig Brady [Fri, 30 Dec 2011 15:36:50 +0000 (15:36 +0000)]
canonicalize: fix references to stat() and lstat()

* lib/canonicalize.c (canonicalize_filename_mode):
Ensure references always resolve to a replacement
function if required (even via a macro).

The issue was spotted by Eric Blake and is
adequately documented in the docs for stat and lstat.

12 years agoautoupdate
Karl Berry [Fri, 30 Dec 2011 15:29:52 +0000 (07:29 -0800)]
autoupdate

12 years agogitlog-to-changelog: remove a little duplication
Jim Meyering [Fri, 30 Dec 2011 14:53:33 +0000 (15:53 +0100)]
gitlog-to-changelog: remove a little duplication

* build-aux/gitlog-to-changelog (main): Grep @lines once,
rather than twice.

12 years agocanonicalize: add support for not resolving symlinks
Pádraig Brady [Thu, 29 Dec 2011 23:49:53 +0000 (23:49 +0000)]
canonicalize: add support for not resolving symlinks

This will initially be used by a new coreutils realpath command.

* lib/canonicalize.h: Add the CAN_NOLINKS flag to
indicate we don't want to follow symlinks.  Also
provide CAN_MODE_MASK to aid setting these existing
mutually exclusive values.
* lib/canonicalize.c (canonicalize_filename_mode):
Extract the flags from can_mode parameter, which
are currently just used to select between stat()
and lstat().  Also ensure that mutually exclusive
values are flagged immediately as invalid.
* tests/test-canonicalize.c: Verify symlinks are
not followed, and that invalid flag combinations
are diagnosed.

12 years agoautoupdate
Karl Berry [Tue, 27 Dec 2011 15:00:31 +0000 (07:00 -0800)]
autoupdate

12 years agoupdate from texinfo
Karl Berry [Mon, 26 Dec 2011 22:15:05 +0000 (14:15 -0800)]
update from texinfo

12 years agogitlog-to-changelog: do not clump multi-paragraph entries
Jim Meyering [Sun, 25 Dec 2011 15:14:36 +0000 (16:14 +0100)]
gitlog-to-changelog: do not clump multi-paragraph entries

Identical header lines (date,name,email+coauthors) are suppressed,
thus putting all entries with those same characteristics under
a single header.  However, when a log entry consists of two or
more paragraphs, it may not be clear where it starts and ends.
This change makes it so that such an entry is always separated
from others by a header line, even when that header would
otherwise be suppressed.
* build-aux/gitlog-to-changelog: Implement the above.
Inspired by a related request from Stefano Lattarini in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29456

12 years agoupdate from texinfo
Karl Berry [Mon, 26 Dec 2011 01:23:01 +0000 (17:23 -0800)]
update from texinfo

12 years agoannounce-gen: fix `cmd' typo in diagnostic
Paul Eggert [Sun, 25 Dec 2011 18:32:13 +0000 (10:32 -0800)]
announce-gen: fix `cmd' typo in diagnostic

* build-aux/announce-gen (print_changelog_deltas): Fix typo in
diagnostic: a missing '$' meant that the command was not output.

12 years agoupdate from texinfo
Karl Berry [Sun, 25 Dec 2011 01:12:46 +0000 (17:12 -0800)]
update from texinfo

12 years agoautoupdate
Karl Berry [Sat, 24 Dec 2011 01:51:08 +0000 (17:51 -0800)]
autoupdate

12 years agotest-framework-sh: distribute init.sh
Jim Meyering [Fri, 23 Dec 2011 15:44:55 +0000 (16:44 +0100)]
test-framework-sh: distribute init.sh

* modules/test-framework-sh (EXTRA_DIST): Append init.sh.
Otherwise, "make -C gnulib-tests check" (at least in grep) would
fail due to the lack of init.sh.

12 years agoautoupdate
Karl Berry [Fri, 23 Dec 2011 14:56:25 +0000 (06:56 -0800)]
autoupdate

12 years agomaint: remove explicit Files: tests/init.sh; depend on test-framework-sh
Jim Meyering [Fri, 23 Dec 2011 11:14:15 +0000 (12:14 +0100)]
maint: remove explicit Files: tests/init.sh; depend on test-framework-sh

* modules/atexit-tests: Rather than listing tests/init.sh,
now that there's a module for it, simply depend on that new module.
* modules/closein-tests: Likewise.
* modules/exclude-tests: Likewise.
* modules/getcwd-tests: Likewise.
* modules/perror-tests: Likewise.
* modules/pread-tests: Likewise.
* modules/pwrite-tests: Likewise.
* modules/vc-list-files-tests: Likewise.
* modules/verify-tests: Likewise.
* modules/xalloc-die-tests: Likewise.
* modules/xstrtoimax-tests: Likewise.
* modules/xstrtol-tests: Likewise.
* modules/xstrtoll-tests: Likewise.
* modules/xstrtoumax-tests: Likewise.
* modules/yesno-tests: Likewise.

12 years agotest-framework-sh: add minimal tests of init.sh's compare function
Jim Meyering [Fri, 23 Dec 2011 09:54:46 +0000 (10:54 +0100)]
test-framework-sh: add minimal tests of init.sh's compare function

* modules/test-framework-sh-tests: New file.
* tests/test-init.sh: New file.

12 years agotest-framework-sh: new module
Jim Meyering [Fri, 23 Dec 2011 09:53:10 +0000 (10:53 +0100)]
test-framework-sh: new module

* modules/test-framework-sh: New file.
* MODULES.html.sh (Support for maintaining and releasing projects):
List it.

12 years agoinit.sh: do not emit simulated diff output to stderr
Jim Meyering [Thu, 22 Dec 2011 15:04:36 +0000 (16:04 +0100)]
init.sh: do not emit simulated diff output to stderr

* tests/init.sh (compare_dev_null_): Print to stdout, not stderr.

12 years ago.gitignore: ignore gnulib.dvi and regex.info
Reuben Thomas [Mon, 19 Dec 2011 08:38:14 +0000 (09:38 +0100)]
.gitignore: ignore gnulib.dvi and regex.info

* doc/.gitignore:add gnulib.dvi and regex.info

12 years agoinit.sh: correct previous change
Jim Meyering [Thu, 22 Dec 2011 12:12:19 +0000 (13:12 +0100)]
init.sh: correct previous change

* tests/init.sh (compare): My previous change was wrong.
Don't clobber "$?".  Spotted by Stefano Lattarini and Pádraig Brady.

12 years agocorrect previous ChangeLog entry: s/set -x/set -e/
Jim Meyering [Thu, 22 Dec 2011 11:58:50 +0000 (12:58 +0100)]
correct previous ChangeLog entry: s/set -x/set -e/

Spotted by Stefano Lattarini.

12 years agoinit.sh: avoid unwarranted test failure when using "set -x"
Jim Meyering [Thu, 22 Dec 2011 11:42:32 +0000 (12:42 +0100)]
init.sh: avoid unwarranted test failure when using "set -x"

* tests/init.sh (compare): Ignore nonzero exit from compare_dev_null_.
Otherwise, in a test script that uses "set -x" (like many in vc-dwim)
a use like "compare exp out" would get evoke an unconditional failure.

12 years agobootstrap: fix it to honor $ACLOCAL_FLAGS once again
Alfred M. Szmidt [Wed, 21 Dec 2011 09:47:03 +0000 (10:47 +0100)]
bootstrap: fix it to honor $ACLOCAL_FLAGS once again

The 2011-12-17 change, commit 767ccd40, replaced a manual invocation
of aclocal that used explicit $ACLOCAL_FLAGS with an invocation of
autoreconf that did not.
* build-aux/bootstrap: Use $ACLOCAL_FLAGS when invoking autoreconf.
Reported by Mats Erik Andersson <gnu@gisladisker.se>.

12 years agobootstrap: remove some now-unneeded code
Jim Meyering [Sat, 17 Dec 2011 16:00:44 +0000 (17:00 +0100)]
bootstrap: remove some now-unneeded code

This script arose back when gnulib-tool was young.
Since then, it has seen improvements that render much of this
script unnecessary.  In particular, it can now make symlinks
to the files it uses.  Also, I no longer see as much value in
marking files as read-only via comments.
If you relied on the symlink-creation feature of the preceding
version of this script, you can get most of that functionality
by adding the --symlink option to the definition of
gnulib_tool_option_extras in your bootstrap.conf file.
* build-aux/bootstrap (AUTOPOINT, AUTORECONF): Factor out definitions.
Run autopoint and libtoolize *before* gnulib-tool.
After it, run an abbreviated autoreconf, rather than a loop around
all tools.
(slirp, bt_mark_as_generated): Remove functions.

12 years agoftoastr: fix typo
Paul Eggert [Mon, 19 Dec 2011 00:30:21 +0000 (16:30 -0800)]
ftoastr: fix typo

* lib/ftoastr.h: Fix misspelling in comment.

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.