Subject: RE: gcc-3.4.4-1: c++: cmath: calling std::isnan results in endless loop
From: "Dave Korn" <[email-masked]>
To: "'Jeff Johnston'" <[email-masked]>, "'Gabriel Dos Reis'" <[email-masked]>
Cc: <[email-masked]>, <[email-masked]>, <[email-masked]>
Date: Mon, 27 Feb 2006 17:28:37 -0000

On 27 February 2006 17:13, Jeff Johnston wrote:

> Gabriel Dos Reis wrote:
>> "Dave Korn" <[email-masked]> writes:
>> 
>> [...]
>> 
>>>   It looks to me like the cygwin/newlib combination is not being
>>> compliant if it implements isnan as a function rather than a macro.  I
>>> couldn't see anything in the standard that says it can be a function, and
>>> every reference to it describes it as a macro, not a function.  It may be
>>> the case that libstdc++ is within its rights to assume that isnan is a
>>> macro after all. 
>> 
>> yes, isnan and friends are supposed to be macros only, not functions.
>> 
> 
> I'll start working on a newlib patch for this.

  Cheers Jeff, I didn't know if it was one of those bits where cygwin
overrides the newlib way of doing things or if it was something we inherited
verbatim from the newlib sources, but now I see that newlib implements it as a
function (only) in s[f]_isnan.c.

  As far as I can see it should be fine to just rename the generic function
(prepend an underscore or three) and make isXXXXX a macro that calls out to
the appropriate type-based one based on typeof (if we're allowed GNU C
extensions) or just by comparing the sizeof the input to the sizeof's the
actual float types (if we aren't).

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/