Subject: Re: libc arch/*/gen cleanup
To: Simon Burge <simonb@wasabisystems.com>
From: Klaus Klein <kleink@reziprozitaet.de>
List: tech-userlevel
Date: 10/29/2001 21:04:29
Simon Burge <simonb@wasabisystems.com> writes:
> How does this look then...
>
> in <math.h> have:
>
> union __infinity_u {
> unsigned char val[8];
> double dummy;
> };
> extern __const union __infinity_u __infinity;
> #define HUGE_VAL (*(__const double *)(__const void *)&__infinity)
Some nits:
* "val" and "dummy" must be moved into implementation-reserved
namespace, too.
* Why magic instead of "unsigned char val[sizeof(double) / sizeof(char)];"?
* The definition of HUGE_VAL looks far too complicated. :-) How about
"#define HUGE_VAL __infinity.dummy"?
> [...]
> One idea that comes to mind is to
> simply have <machine/math.h> declare __HAVE_NANF in the non-vax case,
> and test for this in <math.h>. Is that acceptable from a standards and
> namespace point-of-view?
Sure, sounds like a good idea.
- Klaus