Bruno Haible [Thu, 8 Mar 2012 02:21:38 +0000 (03:21 +0100)]
remainderl: Don't override undeclared system function on IRIX 6.5.
* lib/math.in.h (remainderl): Test HAVE_DECL_REMAINDERL, not
HAVE_REMAINDERL.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL): Don't assume remainderl() is
declared when it exists. Set HAVE_DECL_REMAINDERL.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_REMAINDERL,
not HAVE_REMAINDERL.
* modules/math (Makefile.am): Substitute HAVE_DECL_REMAINDERL, not
HAVE_REMAINDERL.
* doc/posix-functions/remainderl.texi: Mention missing declaration
problem.
Bruno Haible [Thu, 8 Mar 2012 01:27:05 +0000 (02:27 +0100)]
rintf: Don't override undeclared system function on IRIX 6.5.
* lib/math.in.h (rintf): Test HAVE_DECL_RINTF, not HAVE_RINTF.
* m4/rintf.m4 (gl_FUNC_RINTF): Don't assume rintf() is declared when it
exists. Set HAVE_DECL_RINTF.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_RINTF, not
HAVE_RINTF.
* modules/math (Makefile.am): Substitute HAVE_DECL_RINTF, not
HAVE_RINTF.
* doc/posix-functions/rintf.texi: Mention missing declaration problem.
Bruno Haible [Thu, 8 Mar 2012 01:06:10 +0000 (02:06 +0100)]
roundl: Don't override undeclared system function on IRIX 6.5.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Search for roundl() in the libraries
also when it is not declared. Set HAVE_ROUNDL. For replacement code,
test HAVE_ROUNDL, not HAVE_DECL_ROUNDL.
* modules/roundl (configure.ac): For replacement code, test
HAVE_ROUNDL, not HAVE_DECL_ROUNDL.
(Depends-on): Update conditions.
* doc/posix-functions/roundl.texi: Mention the IRIX problem.
Bruno Haible [Thu, 8 Mar 2012 00:55:40 +0000 (01:55 +0100)]
roundf: Don't override undeclared system function on IRIX 6.5.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Search for roundf() in the libraries
also when it is not declared. Set HAVE_ROUNDF. For replacement code,
test HAVE_ROUNDF, not HAVE_DECL_ROUNDF.
* modules/roundf (configure.ac): For replacement code, test
HAVE_ROUNDF, not HAVE_DECL_ROUNDF.
(Depends-on): Update conditions.
* modules/roundf-ieee (Depends-on): Update conditions.
* doc/posix-functions/roundf.texi: Mention the IRIX problem.
Bruno Haible [Thu, 8 Mar 2012 00:26:03 +0000 (01:26 +0100)]
round: Don't override undeclared system function on IRIX 6.5.
* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Accept an optional third
argument.
* m4/round.m4 (gl_FUNC_ROUND): Search for round() in the libraries
also when it is not declared. Set HAVE_ROUND. For replacement code,
test HAVE_ROUND, not HAVE_DECL_ROUND.
* modules/round (configure.ac): For replacement code, test HAVE_ROUND,
not HAVE_DECL_ROUND.
(Depends-on): Update conditions.
* modules/round-ieee (Depends-on): Update conditions.
* doc/posix-functions/round.texi: Mention the IRIX problem.
Bruno Haible [Wed, 7 Mar 2012 23:42:49 +0000 (00:42 +0100)]
copysignf: Don't override undeclared system function on IRIX 6.5.
* lib/math.in.h (copysignf): Test HAVE_DECL_COPYSIGNF, not
HAVE_COPYSIGNF.
* m4/copysignf.m4 (gl_FUNC_COPYSIGNF): Don't assume copysignf() is
declared when it exists. Set HAVE_DECL_COPYSIGNF.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_COPYSIGNF,
not HAVE_COPYSIGNF.
* modules/math (Makefile.am): Substitute HAVE_DECL_COPYSIGNF, not
HAVE_COPYSIGNF.
* doc/posix-functions/copysignf.texi: Mention missing declaration
problem.
Paul Eggert [Tue, 6 Mar 2012 23:19:24 +0000 (15:19 -0800)]
readtokens: avoid core dumps with unusual calling patterns
Reported by Xu Zhongxing in <http://debbugs.gnu.org/10953>.
* lib/readtokens.c: Include limits.h.
(word, bits_per_word, get_nth_bit, set_nth_bit): New.
(readtoken): Don't cache the delimiters; the cache code was buggy
if !delim && saved_delim, or if the new n_delim differs from the old.
Also, it wasn't thread-safe.
Akim Demaille [Wed, 7 Mar 2012 07:35:28 +0000 (23:35 -0800)]
quote: fuse into quotearg
This patch is made for the benefit of Bison.
quote does not leave the choice of the quoting style to the user.
quoting_style provides poor customizability, yet quoting_options,
which is very rich, is hidden inside quotearg.c. So in order to
allow quote customization, move its implementation to quotearg.c.
* lib/quote.c: Remove.
* modules/quote: Adjust.
* lib/quotearg.c (quoting_options_from_style): Fix a compiler
warning: provide all the members of literal structs.
(quote_quoting_options): New.
(quote, quote_n): Import implementation from quote.c.
* lib/quote.h: Import the comments from quote.c.
(quote_quoting_options): New.
Bruno Haible [Tue, 6 Mar 2012 23:38:50 +0000 (00:38 +0100)]
New module 'expm1-ieee'.
* modules/expm1-ieee: New file.
* m4/expm1-ieee.m4: New file.
* m4/expm1.m4 (gl_FUNC_EXPM1): If gl_FUNC_EXPM1_IEEE is present, test
whether expm1 works with a minus zero argument. Replace it if not.
* lib/math.in.h (expm1): Override if REPLACE_EXPM1 is 1.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPM1.
* modules/math (Makefile.am): Substitute REPLACE_EXPM1.
* modules/expm1 (configure.ac): Consider REPLACE_EXPM1.
(Depends-on): Update conditions.
* doc/posix-functions/expm1.texi: Mention the expm1-ieee module and the
AIX problem.
Bruno Haible [Tue, 6 Mar 2012 22:25:51 +0000 (23:25 +0100)]
Work around expm1f bug on IRIX 6.5.
* lib/math.in.h (expm1f): Override if REPLACE_EXPM1F is 1.
* m4/expm1f.m4 (gl_FUNC_EXPM1F_WORKS): New macro.
(gl_FUNC_EXPM1F): Invoke it. Set REPLACE_EXPM1F to 1 if expm1f() does
not work.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPM1F.
* modules/math (Makefile.am): Substitute REPLACE_EXPM1F.
* modules/expm1f (configure.ac): Consider REPLACE_EXPM1F.
(Depends-on): Update conditions.
* doc/posix-functions/expm1f.texi: Mention the IRIX 6.5 bug.
Bruno Haible [Tue, 6 Mar 2012 20:55:34 +0000 (21:55 +0100)]
New module 'expm1l'.
* lib/math.in.h (expm1l): New declaration.
* lib/expm1l.c: New file.
* m4/expm1l.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether expm1l is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_EXPM1L, HAVE_EXPM1L.
* modules/math (Makefile.am): Substitute GNULIB_EXPM1L, HAVE_EXPM1L.
* modules/expm1l: New file.
* tests/test-math-c++.cc: Check the declaration of expm1l.
* doc/posix-functions/expm1l.texi: Mention the new module.
Bruno Haible [Tue, 6 Mar 2012 20:24:28 +0000 (21:24 +0100)]
New module 'expm1f'.
* lib/math.in.h (expm1f): New declaration.
* lib/expm1f.c: New file.
* m4/expm1f.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether expm1f is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_EXPM1F, HAVE_EXPM1F.
* modules/math (Makefile.am): Substitute GNULIB_EXPM1F, HAVE_EXPM1F.
* modules/expm1f: New file.
* tests/test-math-c++.cc: Check the declaration of expm1f.
* doc/posix-functions/expm1f.texi: Mention the new module.
Bruno Haible [Tue, 6 Mar 2012 16:55:54 +0000 (17:55 +0100)]
New module 'expm1'.
* lib/math.in.h (expm1): New declaration.
* lib/expm1.c: New file.
* m4/expm1.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether expm1 is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_EXPM1, HAVE_EXPM1.
* modules/math (Makefile.am): Substitute GNULIB_EXPM1, HAVE_EXPM1.
* modules/expm1: New file.
* tests/test-math-c++.cc: Check the declaration of expm1.
* doc/posix-functions/expm1.texi: Mention the new module.
Bruno Haible [Sun, 4 Mar 2012 19:59:05 +0000 (20:59 +0100)]
fmod* tests: More tests.
* tests/test-fmod.h (my_ldexp): New function.
(test_function): Reduce amount of random numbers to test. Add tests
of very large quotients x / y.
* tests/test-fmod.c (MAX_EXP): New macro.
* tests/test-fmodf.c (MAX_EXP): Likewise.
* tests/test-fmodl.c (MAX_EXP): Likewise.
Jim Meyering [Fri, 2 Mar 2012 17:35:12 +0000 (18:35 +0100)]
maint: don't specify XZ_OPT=-9ev in dist-related rule
Using xz's -9 option is warranted only if you have a very large
tarball (see xz's documentation for the sizes vs. presets), and
requires 64MiB of memory at decompression time.
* top/maint.mk (alpha beta stable): Don't specify XZ_OPT=-9ev.
Automake's default of just "-e" is fine. Override on a
per-package basis by setting XZ_OPT e.g., in cfg.mk.
Eric Blake [Fri, 2 Mar 2012 04:21:09 +0000 (21:21 -0700)]
maint.mk: allow announcement for non-gnulib project
Currently, autoconf does not use a gnulib submodule; this
tripped up the 'make beta' with:
announce-gen: when specifying gnulib as a tool, you must also specify
--gnulib-version=V, where V is the result of running git describe
in the gnulib source directory.
Try 'announce-gen --help' for more information.
* maint.mk (announcement): Skip gnulib version if not used.
Jim Meyering [Thu, 1 Mar 2012 22:20:22 +0000 (23:20 +0100)]
maint.mk: avoid spurious failure of _sc_search_regexp-using tests
* top/maint.mk: Initialize _sc_search_regexp parameters, so that
envvar settings cannot interfere. Otherwise, setting envvars like
prohibit=foo require=bar, etc. would cause spurious test failures.
Eric Blake [Thu, 1 Mar 2012 21:51:31 +0000 (14:51 -0700)]
maint.mk: add per-line exclusions to prohibitions
_sc_search_regexp would let you skip entire files, but not
individual lines, until now. As proof that adding in a new
per-line regex exception mechanism is useful, I found three
syntax checks that were previously open-coded, only because
they had to exclude individual lines.
The exclude filtering is done on 'file:line:contents' output
from grep, rather than the original files, so filtering for
empty lines is a no-op, and searching for contents anchored
at the beginning of the line in the original file should
instead be anchored against ':' at the time of the filtering.
* maint.mk (_sc_search_regexp): Add $exclude parameter.
(sc_prohibit_strcmp, sc_unmarked_diagnostics)
(sc_const_long_option): Use it.
Bruno Haible [Thu, 1 Mar 2012 03:54:18 +0000 (04:54 +0100)]
cbrtl-ieee: Work around test failure on IRIX 6.5.
* m4/cbrtl-ieee.m4: New file.
* m4/cbrtl.m4 (gl_FUNC_CBRTL): If gl_FUNC_CBRTL_IEEE is present,
test whether cbrtl works with a minus zero argument. Replace it if not.
* lib/math.in.h (cbrtl): Override if REPLACE_CBRTL is 1.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_CBRTL.
* modules/math (Makefile.am): Substitute REPLACE_CBRTL.
* modules/cbrtl (configure.ac): Consider REPLACE_CBRTL.
(Depends-on): Update conditions.
* modules/cbrtl-ieee (Files): Add m4/cbrtl-ieee.m4, m4/minus-zero.m4,
m4/signbit.m4.
(configure.ac): Invoke gl_FUNC_CBRTL_IEEE.
* lib/cbrtl.c (cbrtl) [IRIX]: Avoid an unnecessary addition.
* doc/posix-functions/cbrtl.texi: Mention the cbrtl-ieee module.
Bruno Haible [Thu, 1 Mar 2012 02:36:14 +0000 (03:36 +0100)]
cbrtf: Work around bug in IRIX 6.5 system function.
* lib/math.in.h (cbrtf): Override if REPLACE_CBRTF is 1.
* m4/cbrtf.m4 (gl_FUNC_CBRTF_WORKS): New macro.
(gl_FUNC_CBRTF): Invoke it. Set REPLACE_CBRTF to 1 if cbrtf() does not
work.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_CBRTF.
* modules/math (Makefile.am): Substitute REPLACE_CBRTF.
* modules/cbrtf (configure.ac): Consider REPLACE_CBRTF.
(Depends-on): Update conditions.
* doc/posix-functions/cbrtf.texi: Mention the IRIX 6.5 problem.
Bruno Haible [Thu, 1 Mar 2012 01:50:14 +0000 (02:50 +0100)]
New module 'cbrtl'.
* lib/math.in.h (cbrtl): New declaration.
* lib/cbrtl.c: New file.
* m4/cbrtl.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether cbrtl is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_CBRTL, HAVE_CBRTL,
HAVE_DECL_CBRTL.
* modules/math (Makefile.am): Substitute GNULIB_CBRTL, HAVE_CBRTL,
HAVE_DECL_CBRTL.
* modules/cbrtl: New file.
* tests/test-math-c++.cc: Check the declaration of cbrtl.
* doc/posix-functions/cbrtl.texi: Mention the new module.
Bruno Haible [Thu, 1 Mar 2012 01:03:36 +0000 (02:03 +0100)]
New module 'cbrtf'.
* lib/math.in.h (cbrtf): New declaration.
* lib/cbrtf.c: New file.
* m4/cbrtf.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether cbrtf is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_CBRTF, HAVE_CBRTF,
HAVE_DECL_CBRTF.
* modules/math (Makefile.am): Substitute GNULIB_CBRTF, HAVE_CBRTF,
HAVE_DECL_CBRTF.
* modules/cbrtf: New file.
* tests/test-math-c++.cc: Check the declaration of cbrtf.
* doc/posix-functions/cbrtf.texi: Mention the new module.
Bruno Haible [Wed, 29 Feb 2012 22:42:53 +0000 (23:42 +0100)]
cbrt: Provide replacement on MSVC and Minix.
* lib/math.in.h (cbrt): New declaration.
* lib/cbrt.c: New file.
* m4/cbrt.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether cbrt is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_CBRT, HAVE_CBRT.
* modules/math (Makefile.am): Substitute GNULIB_CBRT, HAVE_CBRT.
* modules/cbrt (Files): Add lib/cbrt.c, m4/cbrt.m4.
(Depends-on): Add dependencies.
(configure.ac): Arrange to compile replacement if HAVE_CBRT is 0.
* tests/test-math-c++.cc: Check the declaration of cbrt.
* doc/posix-functions/cbrt.texi: Mention that the module provides a
replacement.
Bruno Haible [Wed, 29 Feb 2012 19:26:22 +0000 (20:26 +0100)]
hypotf-ieee: Work around test failure on OSF/1 and native Windows.
* m4/hypotf-ieee.m4: New file.
* m4/hypotf.m4 (gl_FUNC_HYPOTF): If gl_FUNC_HYPOTF_IEEE is present,
test whether hypotf works with mixed NaN and Infinity arguments.
Replace it if not.
* modules/hypotf-ieee (Files): Add m4/hypotf-ieee.m4.
(Depends-on): Add hypot-ieee.
(configure.ac): Invoke gl_FUNC_HYPOTF_IEEE.
* doc/posix-functions/hypotf.texi: Mention the hypotf-ieee module.
Bruno Haible [Wed, 29 Feb 2012 19:00:38 +0000 (20:00 +0100)]
hypot-ieee: Work around test failure on OSF/1 and native Windows.
* lib/math.in.h (hypot): New declaration.
* lib/hypot.c: New file.
* m4/hypot-ieee.m4: New file.
* m4/hypot.m4 (gl_FUNC_HYPOT): If gl_FUNC_HYPOT_IEEE is present, test
whether hypot works with mixed NaN and Infinity arguments. Replace it
if not.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize GNULIB_HYPOT,
REPLACE_HYPOT.
* modules/math (Makefile.am): Substitute GNULIB_HYPOT, REPLACE_HYPOT.
* modules/hypot (Files): Add lib/hypot.c.
(Depends-on): Add dependencies.
(configure.ac): Arrange to compile replacement if REPLACE_HYPOT is 1.
* modules/hypot-ieee (Files): Add m4/hypot-ieee.m4.
(configure.ac): Invoke gl_FUNC_HYPOT_IEEE.
* tests/test-math-c++.cc: Check the declaration of hypot.
* doc/posix-functions/hypot.texi: Mention the hypot-ieee module.
Eric Blake [Wed, 29 Feb 2012 15:36:22 +0000 (08:36 -0700)]
termios: fix pid_t always, not just for tcgetsid
tests-termios.c was failing on more than just cygwin.
* doc/posix-headers/termios.texi (termios.h): Mention problem.
* lib/termios.in.h (include): Ensure pid_t on all platforms, not
just when building tcgetsid.
Eric Blake [Tue, 28 Feb 2012 00:35:56 +0000 (17:35 -0700)]
tcgetsid: fix cygwin header bug
Cygwin added tcgetsid in 1.7.10, but with int instead of pid_t:
http://cygwin.com/ml/cygwin-patches/2012-q1/msg00031.html
For now, since cygwin's pid_t is int, I'm not worrying about
correcting the return type.
* lib/termios.in.h (includes) [Cygwin]: Ensure pid_t is defined.
Bruno Haible [Tue, 28 Feb 2012 19:40:59 +0000 (20:40 +0100)]
math: Ensure HUGE_VAL, HUGE_VALF, HUGE_VALL are defined.
* lib/math.in.h (HUGE_VAL, HUGE_VALF, HUGE_VALL): Define fallbacks.
* tests/test-math.c: Include macros.h. Check that HUGE_VAL, HUGE_VALF,
HUGE_VALL are defined.
(numeric_equald): Renamed from numeric_equal.
(numeric_equalf, numeric_equall): New functions.
(main): Check also HUGE_VALF, HUGE_VALL.
* modules/math-tests (Files): Add tests/macros.h.
* doc/posix-headers/math.texi: Document the problems with HUGE_VALF and
HUGE_VALL.
Paul Eggert [Wed, 29 Feb 2012 09:48:18 +0000 (01:48 -0800)]
stdnoreturn: port to MSVC better
MSVC standard headers use __declspec(noreturn), so #define noreturn
to empty on that platform. Reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-02/msg00152.html>.
* lib/stdnoreturn.in.h (noreturn): Define to empty on MSVC.
* doc/posix-headers/stdnoreturn.texi (stdnoreturn.h): Document this.
Bruno Haible [Tue, 28 Feb 2012 12:03:39 +0000 (13:03 +0100)]
doc: Mention new glibc headers and functions.
* doc/glibc-headers/uchar.texi: New file.
* doc/glibc-functions/aligned_alloc.texi: New file.
* doc/glibc-functions/c16rtomb.texi: New file.
* doc/glibc-functions/c32rtomb.texi: New file.
* doc/glibc-functions/clock_adjtime.texi: New file.
* doc/glibc-functions/fanotify_init.texi: New file.
* doc/glibc-functions/fanotify_mark.texi: New file.
* doc/glibc-functions/inet6_opt_append.texi: New file.
* doc/glibc-functions/inet6_opt_find.texi: New file.
* doc/glibc-functions/inet6_opt_finish.texi: New file.
* doc/glibc-functions/inet6_opt_get_val.texi: New file.
* doc/glibc-functions/inet6_opt_init.texi: New file.
* doc/glibc-functions/inet6_opt_next.texi: New file.
* doc/glibc-functions/inet6_opt_set_val.texi: New file.
* doc/glibc-functions/inet6_rth_add.texi: New file.
* doc/glibc-functions/inet6_rth_getaddr.texi: New file.
* doc/glibc-functions/inet6_rth_init.texi: New file.
* doc/glibc-functions/inet6_rth_reverse.texi: New file.
* doc/glibc-functions/inet6_rth_segments.texi: New file.
* doc/glibc-functions/inet6_rth_space.texi: New file.
* doc/glibc-functions/login.texi: New file.
* doc/glibc-functions/mbrtoc16.texi: New file.
* doc/glibc-functions/mbrtoc32.texi: New file.
* doc/glibc-functions/name_to_handle_at.texi: New file.
* doc/glibc-functions/ntp_gettimex.texi: New file.
* doc/glibc-functions/open_by_handle_at.texi: New file.
* doc/glibc-functions/prlimit.texi: New file.
* doc/glibc-functions/process_vm_readv.texi: New file.
* doc/glibc-functions/process_vm_writev.texi: New file.
* doc/glibc-functions/recvmmsg.texi: New file.
* doc/glibc-functions/scandirat.texi: New file.
* doc/glibc-functions/sendmmsg.texi: New file.
* doc/glibc-functions/setns.texi: New file.
* doc/glibc-functions/timespec_get.texi: New file.
* doc/gnulib.texi: Include them.
(Glibc sys/fanotify.h, Glibc sys/resource.h, Glibc uchar.h): New
sections.
Reported by Eric Blake.