This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]