[PATCH] math.h: Do use __MATH_TG_BUILTIN_CLASSIFY for C++

Florian Weimer fw@deneb.enyo.de
Tue Dec 30 10:01:04 GMT 2025


* Adhemerval Zanella:

> @@ -1247,12 +1251,17 @@ enum
>  #  define isinf(x) \
>      (__builtin_types_compatible_p (__typeof (x), _Float128) \
>       ? __isinff128 (x) : __builtin_isinf_sign (x))
> -# elif (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \
> -       || __glibc_clang_prereq (3,7)
> +  /* The __MATH_TG_BUILTIN_CLASSIFY macro can not be used in C++ mode due
> +     it might use __builtin_types_compatible_p, which is C-only builtin.  */
> +# elif ((__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \
> +        || __glibc_clang_prereq (3,7)) \
> +     && !defined __cplusplus
>  #  define isinf(x) __MATH_TG_BUILTIN_CLASSIFY ((x),			      \

… not be used in C++ mode [because] it might use …

I agree with H.J.  Without a test case, it's hard to see what this is
about.


More information about the Libc-alpha mailing list