This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH 2/6] float128: Add conversion from float128 to mpn
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 1 Jun 2017 13:23:25 +0000
- Subject: Re: [PATCH 2/6] float128: Add conversion from float128 to mpn
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <alpine.DEB.firstname.lastname@example.org> <email@example.com>
On Mon, 29 May 2017, Gabriel F. T. Gomes wrote:
> The file sysdeps/ieee754/ldbl-128/ldbl2mpn.c includes stdlib/gmp-impl.h,
> which defines MAX and MIN. With the changes to ldbl2mpn.c, the inclusion
> of float128_private.h will indirectly include sys/param.h, redefining the
> I attached a new patch which replaces the definition of MAX and MIN in
> stdlib/gmp-impl.h with an inclusion of sys/param.h.
> Is the attached patch OK for master?
That patch is OK.
> > > +#define __FLOAT128_OVERRIDE
> > > +
> > > +#include "../ldbl-128/ldbl2mpn.c"
> > Is there a reason you need a sepcial __FLOAT128_OVERRIDE macro, instead of
> > the approach used by the other float128 files of including
> > <float128_private.h>, which defines all relevant macros (e.g. defining
> > __mpn_extract_long_double to __mpn_extract_float128, and with the
> > __mpn_extract_long_double definition using _Float128 as the type name and
> > letting math_ldbl.h redefine that back to long double as needed)?
> I could not use the same approach, because ldbl2mpn.c includes the header
> include/gmp.h, which declares both __mpn_extract_long_double and
> __mpn_extract_float128. I would end up declaring __mpn_extract_float128
This sounds like an include ordering problem. float128_private.h
redefines lots of names from math_private.h and math.h. But that doesn't
cause problems because it includes those headers first. So how about
making float128_private.h include gmp.h before redefining
Joseph S. Myers