[PATCH] Another huge_val.h fix
Jakub Jelinek
jakub@redhat.com
Sun May 21 11:57:00 GMT 2000
> > Fortunately g++ 2.96 does (ObjC did already in 2.95), so IMHO we have three
> > choices:
> > - simply prereq 2.96 like done with this patch
> > - use # if __GNUC_PREREQ(2,96) || (__GNUC_PREREQ(2,95) && !defined(__cplusplus))
> > - kill the hex floating consts bits from huge_val.h
>
> HUGE_VAL is required by some standards. IMO we can't just disable it for
> gcc <= 2.95, especially since 2.96 is not released yet.
>
> The only practical solution I see is to leave it the way it is and
> condem -pedantic.
#if __GNUC_PREREQ(2,96)
does not disable it for gcc <= 2.95, see huge_val.h, it is just a nicer way
of specifying that constant.
For older gcc (to which by this patch is added gcc 2.95 due to g++), it uses
the other definition, e.g.:
#ifdef __GNUC__
# if __GNUC_PREREQ(2,96)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
# endif
#else
Lame definition for non-gcc compilers
#endif
Jakub
More information about the Libc-hacker
mailing list