From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 24 12:40:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.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 15DAF578 for ; Sat, 24 Aug 2013 12:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAB5B2C50 for ; Sat, 24 Aug 2013 12:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OCe0Mi067766 for ; Sat, 24 Aug 2013 12:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r7OCe0u8067716; Sat, 24 Aug 2013 12:40:00 GMT (envelope-from gnats) Resent-Date: Sat, 24 Aug 2013 12:40:00 GMT Resent-Message-Id: <201308241240.r7OCe0u8067716@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jan Beich 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 E690254A for ; Sat, 24 Aug 2013 12:36:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7CD92C3A for ; Sat, 24 Aug 2013 12:36:41 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7OCafv2074782 for ; Sat, 24 Aug 2013 12:36:41 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7OCaf2f074761; Sat, 24 Aug 2013 12:36:41 GMT (envelope-from nobody) Message-Id: <201308241236.r7OCaf2f074761@oldred.freebsd.org> Date: Sat, 24 Aug 2013 12:36:41 GMT From: Jan Beich To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/181501: [regression] libstdc++ vs. std::isfinite() since math.h@r253260 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 12:40:01 -0000 >Number: 181501 >Category: kern >Synopsis: [regression] libstdc++ vs. std::isfinite() since math.h@r253260 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 24 12:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Jan Beich >Release: FreeBSD 10.0-CURRENT amd64 >Organization: >Environment: >Description: Recent math.h cleanup made c++ inconsistent in how it treats an integer argument for float functions between different standard libraries. cf. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027280.html >How-To-Repeat: $ cat a.cc #include int main() { std::isfinite(5); return 0; } $ c++ -stdlib=libc++ a.cc $ c++ -stdlib=libstdc++ a.cc In file included from a.cc:1: /usr/include/c++/4.2/cmath:472:51: error: controlling expression type 'int' not compatible with any generic association type __capture_isfinite(_Tp __f) { return isfinite(__f); } ^~~ /usr/include/math.h:115:38: note: expanded from macro 'isfinite' #define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel) ^ /usr/include/math.h:86:49: note: expanded from macro '__fp_type_select' #define __fp_type_select(x, f, d, ld) _Generic((x), \ ^ /usr/include/c++/4.2/cmath:543:45: note: in instantiation of function template specialization '__gnu_cxx::__capture_isfinite' requested here isfinite(_Tp __f) { return ::__gnu_cxx::__capture_isfinite(__f); } ^ a.cc:5:8: note: in instantiation of function template specialization 'std::isfinite' requested here std::isfinite(5); ^ 1 error generated. >Fix: either !defined(__cplusplus) or !defined(__GLIBCXX__) --- math.h_cxx.diff begins here --- Index: lib/msun/src/math.h =================================================================== --- lib/msun/src/math.h (revision 254772) +++ lib/msun/src/math.h (working copy) @@ -82,7 +82,7 @@ extern const union __nan_un { #define FP_ZERO 0x10 #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ - __has_extension(c_generic_selections) + __has_extension(c_generic_selections) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) _Generic((x), \ float: f(x), \ double: d(x), \ --- math.h_cxx.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: