X-Spam-Check-By: sourceware.org From: "Dave Korn" To: "'Jeff Johnston'" , "'Gabriel Dos Reis'" Cc: , , Subject: RE: gcc-3.4.4-1: c++: cmath: calling std::isnan results in endless loop Date: Mon, 27 Feb 2006 17:28:37 -0000 Message-ID: <01db01c63bc3$3e12aa70$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <44033332.7020801@redhat.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 27 February 2006 17:13, Jeff Johnston wrote: > Gabriel Dos Reis wrote: >> "Dave Korn" 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/