[PATCH] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm
Joseph Myers
joseph@codesourcery.com
Tue Oct 3 14:54:00 GMT 2017
On Tue, 3 Oct 2017, Gabriel F. T. Gomes wrote:
> [BZ #22235]
> * math/Makefile [CXX] (tests): Add test-math-iscanonical.cc.
> (CFLAGS-test-math-iscanonical.cc): New variable.
> * math/test-math-iscanonical.cc: New file.
> * sysdeps/ieee754/ldbl-96/bits/iscanonical.h (iscanonical):
> Provide a C++ implementation based on function overloading,
> rather than using __MATH_TG, which uses C-only builtins.
> * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h (iscanonical):
> Likewise.
> * sysdeps/powerpc/powerpc64le/Makefile
> (CFLAGS-test-math-iscanonical.cc): New variable.
OK, but note
> +/* In C++ mode, __MATH_TG cannot be used, because it relies on
> + __builtin_types_compatible_p, which is a C-only builtin. On the
> + other hand, overloading provides the means to distinguish between
> + the floating-point types. The overloading resolution will match
> + the correct parameter (regardless of type qualifiers (i.e.: const
> + and volatile). */
(twice in this patch, and once already in math.h) is missing a second
close parenthesis to match the first open parenthesis, and should be
fixed.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list