This is the mail archive of the
mailing list for the newlib project.
Re: Possible Issue in ieeefp.h
- From: Craig Howland <howland at LGSInnovations dot com>
- To: <newlib at sourceware dot org>
- Date: Mon, 21 Nov 2016 11:26:43 -0500
- Subject: Re: Possible Issue in ieeefp.h
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
On 11/21/2016 11:08 AM, Joel Sherrill wrote:
ieeefp.h is definitely intending to use LDBL_MANT_DIG. This is the C-standard
defined name which is supposed to be defined in float.h, and which ieeefp.h
directly states it is relying on. Apparently the float.h being used is not
properly defined/set up, and this is what needs to be corrected.
An RTEMS user has tried to build GNU FORTRAN. It used to build
and test OK. I am copying his report and my suggestion. I think
the constants tested in ieeefp.h do NOT match those predefined
by GCC. I need someone more knowledgable to confirm.
On Mon, Nov 21, 2016 at 9:24 AM, Ricardo Derbes <firstname.lastname@example.org> wrote:
I'm trying to build rtems toolchain for i386 using
rtems-source-builder with fortran support (--with-fortran option).
The RSB I'm using has been dowloaded from git, commit
534332f22a66f16b4022e87ae50c11ff20c98dcb from Sep 12 2016.
As for my application I need fortran support, how can I fix this problem?
As long I can see, all symbols that the compiler claims as undeclared
are indeed declared and accessible in file
May be it's missing a symbol, e.g a proper value for LDBL_MANT_DIG ?
I see that GCC predefines these symbols:
#define __FLT_MANT_DIG__ 24
#define __DEC64_MANT_DIG__ 16
#define __LDBL_MANT_DIG__ 53
#define __DBL_MANT_DIG__ 53
#define __DEC32_MANT_DIG__ 7
#define __DEC128_MANT_DIG__ 34
And ieeefp.h in newlib has this:
#elif LDBL_MANT_DIG == 53
/* This happens when doubles are 32-bits and long doubles are 64-bits. */
#define EXT_EXPBITS 11
#define EXT_FRACHBITS 20
#define EXT_FRACLBITS 32
#define __ieee_ext_field_type unsigned long
I am suspicious that the ifdef should use __LDBL_MANT_DIG__ not LDBL_MANT_DIG.