From owner-freebsd-current@FreeBSD.ORG Sat Jul 13 12:26:10 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0909A388; Sat, 13 Jul 2013 12:26:10 +0000 (UTC) (envelope-from pasi.parviainen@iki.fi) Received: from sypressi.dnainternet.net (sypressi.dnainternet.net [83.102.40.135]) by mx1.freebsd.org (Postfix) with ESMTP id AC5C81DF2; Sat, 13 Jul 2013 12:26:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sypressi.dnainternet.net (Postfix) with ESMTP id 5BFB72618E4; Sat, 13 Jul 2013 15:20:22 +0300 (EEST) X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from sypressi.dnainternet.net ([83.102.40.135]) by localhost (sypressi.dnainternet.net [127.0.0.1]) (DNA Postiturva, port 10041) with ESMTP id vCYO0WFvf7n2; Sat, 13 Jul 2013 15:20:21 +0300 (EEST) Received: from luumupuu.dnainternet.net (luumupuu.dnainternet.net [83.102.40.213]) by sypressi.dnainternet.net (Postfix) with ESMTP id DC8C72618E9; Sat, 13 Jul 2013 15:20:21 +0300 (EEST) Received: from [192.168.0.2] (host-109-204-160-251.tp-fne.tampereenpuhelin.net [109.204.160.251]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by luumupuu.dnainternet.net (Postfix) with ESMTPS id 79EDD5FA7F; Sat, 13 Jul 2013 15:20:12 +0300 (EEST) Message-ID: <51E145CC.8080900@iki.fi> Date: Sat, 13 Jul 2013 15:19:24 +0300 From: Pasi Parviainen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: David Chisnall Subject: Re: CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++: isnan()/isninf() oddity 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> <20130712234749.5afa3c9b@thor.walstatt.dyndns.org> <9B0A6D14-640E-4ADD-8E58-0B7867C7C674@FreeBSD.org> In-Reply-To: <9B0A6D14-640E-4ADD-8E58-0B7867C7C674@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 13 Jul 2013 13:05:30 +0000 Cc: Scot Hetzel , "freebsd-standards@FreeBSD.org" , "freebsd-toolchain@FreeBSD.org" , Garrett Wollman , FreeBSD Current , Bruce Evans , Tijl Coosemans , "O. Hartmann" 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: Sat, 13 Jul 2013 12:26:10 -0000 On 13.7.2013 13:12, David Chisnall wrote: > On 12 Jul 2013, at 22:47, "O. Hartmann" wrote: > >> Obviously not really fixed, but even worse: >> >> if I use in C code (C99, using clang 3.3 on FreeBSD 10.0-CURRENT/amd64 >> revision 253287) isnan(x) where x is a "const double", I receive now >> the following error (which doesn't appear on previous versions): > > Thanks. This is now fixed, however the _Generic() usage that we had there is also present in tgmath.h, and so this file will also need to be fixed in the same way. > > I've now tested the macros with clang/c99, clang/c11, clang/c++98 and clang/c++11, and gcc/c89 and they all seem to work for unqualified, const, volatile, and const-volatile qualified types. > > I've added Ed to the cc: list, as he wrote this code in tgmath.h. > > David > Instead of listing all possible type qualifier combinations (like in r253319), how about using a comma operator to strip away type qualifiers? Since only the result type of the expression matters and it isn't evaluated at all. like: #define __fp_type_select(x, f, d, ld) _Generic((0,(x)), Pasi