Why do we need to fixinclude HUGE_VAL definitions in math.h?

Kai Henningsen kaih@khms.westfalen.de
Wed Jul 16 03:24:00 GMT 2003


zack@codesourcery.com (Zack Weinberg)  wrote on 12.07.03 in <87fzla6hh6.fsf@egil.codesourcery.com>:

> Nathanael Nerode <neroden@twcny.rr.com> writes:
>
> >>>I can't figure out *why*, though.  Who's defining HUGE_VAL before math.h
> >>>and wants to keep it from being trashed?
> ...
> > So if it only triggers once (on math.h, in particular, I suspect :-)
> > then it's innocuous but unnecessary.  If it triggers anywhere is, it's
> > necessary.
>
> For what it's worth, SUS2001 and C99 agree that math.h is the only
> place that should define HUGE_VAL{,F,L}.
>
> > That makes sense. :-)  There must be a reasonable way to say "bypass
> > for math.h".
>
> Well, no, we don't want to do that - if there is some other place that
> defines HUGE_VAL, and it's put first, and it disagrees with math.h,
> the user will get errors.
>
> It might make sense instead to have the fix delete any definition of
> HUGE_VAL that's *not* in math.h, but that might cause other problems.

Such as when some machine gets it from a /bits/-style header ...

MfG Kai



More information about the Gcc mailing list