From owner-freebsd-current@FreeBSD.ORG Sun Jul 28 21:27:15 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C9867A6; Sun, 28 Jul 2013 21:27:15 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5872B45; Sun, 28 Jul 2013 21:27:13 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id hi8so3483393lab.7 for ; Sun, 28 Jul 2013 14:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Rvb+Xw1Xmjeny08DFaM9CxfCpANkexBCMuHIKllYarw=; b=j0TmsaLc7Nfu1nd3dXPkbtRPCQPsB2YBuicVU1fneXk2Gxg5dbGhJztTxTyGXn+L4H e9ZiHtW8w276LILx8lUU9dPePUEwgBI/ZZePHONLd4SonYPyO3wB0JkN6S6NWBo1D3MW Xho2tOcLyGvLK9uZ/QsfEG4hUVSkRukP5VluVmjn4GAe6kYCjlmY8YULq3s/XMl/j+du N3IOw54QjBX1hVBO2QCiBEJuPKvoK6m9dASVsqzDb06GuxpVY7ZGfbSlVdZOLCwy7jLO AmlOoiiA/kp9B4tR9T+btdEGpbUkuk5wdsfxUk2pJ7whp4AdX4iT3+OvkbFTAYPZ4SmN 91Rg== X-Received: by 10.112.53.10 with SMTP id x10mr24743382lbo.28.1375046832077; Sun, 28 Jul 2013 14:27:12 -0700 (PDT) Received: from orwell.Elisa.gmail.com (a91-154-115-217.elisa-laajakaista.fi. [91.154.115.217]) by mx.google.com with ESMTPSA id k10sm4959313lbl.10.2013.07.28.14.27.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 28 Jul 2013 14:27:11 -0700 (PDT) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: Pasi Parviainen 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> <51E145CC.8080900@iki.fi> Date: Mon, 29 Jul 2013 00:27:02 +0300 In-Reply-To: <51E145CC.8080900@iki.fi> (Pasi Parviainen's message of "Sat, 13 Jul 2013 15:19:24 +0300") Message-ID: <861u6iv0ih.fsf@orwell.Elisa> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: Scot Hetzel , "O. Hartmann" , David Chisnall , "freebsd-toolchain@FreeBSD.org" , Garrett Wollman , FreeBSD Current , 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: Sun, 28 Jul 2013 21:27:15 -0000 Pasi Parviainen writes: > 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)), This seems to have been committed in r253321, and broke some code that was working with r253320; namely, some code in x11/kde4-workspace includes math.h and calls isnan() with a const double.