From owner-freebsd-current@FreeBSD.ORG Fri Jul 12 16:16:47 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0DA321B; Fri, 12 Jul 2013 16:16:47 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0241E6F; Fri, 12 Jul 2013 16:16:47 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 16so21260016iea.17 for ; Fri, 12 Jul 2013 09:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=080gMjUYyiD0/PHb/kkcV71HbnZ9j2lWJ1l/2+iWDyM=; b=p0dQlnQBjlxO3/wrsnkArUdPVcRKw0V+NP1s/DtWDZJxC3SQkmlZMPMiptnwqP9Cuq NGl0n4Q3jme7BHxocXH8A0sf8Mq/BO/zulcHzka4d2FyGI9KwQ60Jci/HpxXfbiltGdP fBdbOhqA872YMuWvKuwpdEuaImMm86yLIA+QzKpVgnxckDHzTKbWPJS4LQQkCSWjyfJK 59/0DzsTo5xIAgutuhiJZV6DlD0hWM2GBwRI8NDzyA9M7tF+mXzd58j1UljRYPc9UPnM IrwusFOLdkQn7fLwaV5LXFIFYfpJ5Vyyxdpp3HdL8spphaP5QL4P3o0bYtIQL5JIrrQS hJAA== MIME-Version: 1.0 X-Received: by 10.50.57.51 with SMTP id f19mr1178741igq.26.1373645807137; Fri, 12 Jul 2013 09:16:47 -0700 (PDT) Received: by 10.50.221.179 with HTTP; Fri, 12 Jul 2013 09:16:46 -0700 (PDT) In-Reply-To: References: <20130710155809.0f589c22@thor.walstatt.dyndns.org> <20130710183315.725dfde0@thor.walstatt.dyndns.org> <20130710203200.5359fd18@thor.walstatt.dyndns.org> <51DDC04B.6040209@FreeBSD.org> <20957.49978.73666.392417@khavrinen.csail.mit.edu> <20130711130043.R920@besplex.bde.org> <20130711202908.L84170@besplex.bde.org> Date: Fri, 12 Jul 2013 11:16:46 -0500 Message-ID: Subject: Re: CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++: isnan()/isninf() oddity From: Scot Hetzel To: David Chisnall Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD CURRENT , Garrett Wollman , "freebsd-toolchain@FreeBSD.org" , Bruce Evans , Tijl Coosemans , "freebsd-standards@FreeBSD.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 16:16:47 -0000 On Thu, Jul 11, 2013 at 9:33 AM, David Chisnall wrote: > On 11 Jul 2013, at 13:11, Bruce Evans wrote: > >> The error message for the __builtin_isnan() version is slightly better up >> to where it says more. >> >> The less-unportable macro can do more classification and detect problems >> at compile time using __typeof(). > > The attached patch fixes the related test cases in the libc++ test suite. Please review. > #define fpclassify(x) \ - ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \ - : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \ - : __fpclassifyl(x)) + __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyd) The last __fpclassifyd should be __fpclassifyl. -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.