* [PATCH] Don't provide scalb/significand _FloatN aliases [BZ #31760]
@ 2024-05-20 16:56 H.J. Lu
2024-05-22 12:38 ` Adhemerval Zanella Netto
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2024-05-20 16:56 UTC (permalink / raw)
To: libc-alpha
scalb is a deprecated interface which was obsolescent in POSIX.1-2001,
removed in POSIX.1-2008, never made to C standard. significant was
originally from BSD and never made in any standard. Fix BZ #31760 by
not providing _FloatN aliases for them.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
math/s_significand_template.c | 12 ++++++++++++
math/w_scalb_template.c | 12 ++++++++++++
2 files changed, 24 insertions(+)
diff --git a/math/s_significand_template.c b/math/s_significand_template.c
index a351390411..0c8a1c3d75 100644
--- a/math/s_significand_template.c
+++ b/math/s_significand_template.c
@@ -30,4 +30,16 @@ M_DECL_FUNC (__significand) (FLOAT x)
{
return M_SUF (__ieee754_scalb) (x,(FLOAT) - M_SUF (__ilogb) (x));
}
+
+/* Don't provide _FloatN aliases for significand which was originally
+ from BSD and never made in any standard. */
+#undef libm_alias_float_other_r
+#define libm_alias_float_other_r(from, to, r)
+#undef libm_alias_double_other_r
+#define libm_alias_double_other_r(from, to, r)
+#undef libm_alias_ldouble_other_r
+#define libm_alias_ldouble_other_r(from, to, r)
+#undef libm_alias_float128_other_r
+#define libm_alias_float128_other_r(from, to, r)
+
declare_mgen_alias (__significand, significand)
diff --git a/math/w_scalb_template.c b/math/w_scalb_template.c
index 2fd5ca1878..f9f98508e9 100644
--- a/math/w_scalb_template.c
+++ b/math/w_scalb_template.c
@@ -52,6 +52,18 @@ FLOAT M_DECL_FUNC (__scalb) (FLOAT x, FLOAT fn)
return z;
}
+/* Don't provide _FloatN aliases for scalb which is a deprecated interface,
+ was obsolescent in POSIX.1-2001, removed in POSIX.1-2008, never made to
+ C standard. */
+#undef libm_alias_float_other_r
+#define libm_alias_float_other_r(from, to, r)
+#undef libm_alias_double_other_r
+#define libm_alias_double_other_r(from, to, r)
+#undef libm_alias_ldouble_other_r
+#define libm_alias_ldouble_other_r(from, to, r)
+#undef libm_alias_float128_other_r
+#define libm_alias_float128_other_r(from, to, r)
+
declare_mgen_alias (__scalb, scalb);
#endif /* __USE_WRAPPER_TEMPLATE. */
--
2.45.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Don't provide scalb/significand _FloatN aliases [BZ #31760]
2024-05-20 16:56 [PATCH] Don't provide scalb/significand _FloatN aliases [BZ #31760] H.J. Lu
@ 2024-05-22 12:38 ` Adhemerval Zanella Netto
0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella Netto @ 2024-05-22 12:38 UTC (permalink / raw)
To: H.J. Lu, libc-alpha
On 20/05/24 13:56, H.J. Lu wrote:
> scalb is a deprecated interface which was obsolescent in POSIX.1-2001,
> removed in POSIX.1-2008, never made to C standard. significant was
> originally from BSD and never made in any standard. Fix BZ #31760 by
> not providing _FloatN aliases for them.
>
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> math/s_significand_template.c | 12 ++++++++++++
> math/w_scalb_template.c | 12 ++++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/math/s_significand_template.c b/math/s_significand_template.c
> index a351390411..0c8a1c3d75 100644
> --- a/math/s_significand_template.c
> +++ b/math/s_significand_template.c
> @@ -30,4 +30,16 @@ M_DECL_FUNC (__significand) (FLOAT x)
> {
> return M_SUF (__ieee754_scalb) (x,(FLOAT) - M_SUF (__ilogb) (x));
> }
> +
> +/* Don't provide _FloatN aliases for significand which was originally
> + from BSD and never made in any standard. */
> +#undef libm_alias_float_other_r
> +#define libm_alias_float_other_r(from, to, r)
> +#undef libm_alias_double_other_r
> +#define libm_alias_double_other_r(from, to, r)
> +#undef libm_alias_ldouble_other_r
> +#define libm_alias_ldouble_other_r(from, to, r)
> +#undef libm_alias_float128_other_r
> +#define libm_alias_float128_other_r(from, to, r)
> +
> declare_mgen_alias (__significand, significand)
> diff --git a/math/w_scalb_template.c b/math/w_scalb_template.c
> index 2fd5ca1878..f9f98508e9 100644
> --- a/math/w_scalb_template.c
> +++ b/math/w_scalb_template.c
> @@ -52,6 +52,18 @@ FLOAT M_DECL_FUNC (__scalb) (FLOAT x, FLOAT fn)
> return z;
> }
>
> +/* Don't provide _FloatN aliases for scalb which is a deprecated interface,
> + was obsolescent in POSIX.1-2001, removed in POSIX.1-2008, never made to
> + C standard. */
> +#undef libm_alias_float_other_r
> +#define libm_alias_float_other_r(from, to, r)
> +#undef libm_alias_double_other_r
> +#define libm_alias_double_other_r(from, to, r)
> +#undef libm_alias_ldouble_other_r
> +#define libm_alias_ldouble_other_r(from, to, r)
> +#undef libm_alias_float128_other_r
> +#define libm_alias_float128_other_r(from, to, r)
> +
> declare_mgen_alias (__scalb, scalb);
>
> #endif /* __USE_WRAPPER_TEMPLATE. */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-22 12:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20 16:56 [PATCH] Don't provide scalb/significand _FloatN aliases [BZ #31760] H.J. Lu
2024-05-22 12:38 ` Adhemerval Zanella Netto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).