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

Zack Weinberg zack@codesourcery.com
Sun Jul 13 12:01:00 GMT 2003


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.

zw



More information about the Gcc mailing list