From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 314C81F461 for ; Tue, 27 Aug 2019 20:49:12 +0000 (UTC) Received: from localhost ([::1]:58432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2iOs-0007VS-NM for normalperson@yhbt.net; Tue, 27 Aug 2019 16:49:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52391) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2hyB-0002yp-Fv for bug-gnulib@gnu.org; Tue, 27 Aug 2019 16:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2hy9-0002rH-Qo for bug-gnulib@gnu.org; Tue, 27 Aug 2019 16:21:34 -0400 Received: from mail8.parnet.fi ([77.234.108.134]:21566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2hy9-0002qC-KS for bug-gnulib@gnu.org; Tue, 27 Aug 2019 16:21:33 -0400 Received: from mail7.parnet.fi (mail7.parnet.fi [77.234.108.28]) by mail8.parnet.fi with ESMTP id x7RKLVfa004078-x7RKLVfc004078 (version=TLSv1.0 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 27 Aug 2019 23:21:31 +0300 Received: from foo.martin.st (host-96-177.parnet.fi [77.234.96.177]) by mail7.parnet.fi (8.13.8/8.13.8) with ESMTP id x7RKLU26009346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 27 Aug 2019 23:21:31 +0300 Date: Tue, 27 Aug 2019 23:21:30 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: bug-gnulib@gnu.org Subject: isnan function conflicts with C++ standard library declarations Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-864930931-1566937291=:6969" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 77.234.108.134 X-Mailman-Approved-At: Tue, 27 Aug 2019 16:49:07 -0400 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-864930931-1566937291=:6969 Content-Type: text/plain; format=flowed; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail8.parnet.fi id x7RKLVfa004078-x7RKLVfc004078 Hi, When the isnan function is enabled in gnulib, the added bits in math.h=20 break if included in C++ translation units. A minimal reproducion example is available at=20 https://martin.st/temp/gnulib-isnan-repro-0.0.0.tar.gz (preconfigured and= =20 directly buildable) and=20 https://martin.st/temp/gnulib-isnan-repro-source.tar.gz (original source,= =20 requires running gnulib-tool and autoreconf). The error manifests both with GCC/libstdc++ and Clang/libc++, with error=20 messages like these: In file included from myprog.cpp:2:0: lib/math.h: In function =A1int isnan(float)=A2: lib/math.h:2829:1: error: =A1int isnan(float)=A2 conflicts with a previou= s declaration _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan) ^ In file included from /usr/include/c++/7/math.h:36:0, from lib/math.h:27, from myprog.cpp:2: /usr/include/c++/7/cmath:618:3: note: previous declaration =A1constexpr b= ool std::isnan(float)=A2 isnan(float __x) ^~~~~ Or this: In file included from myprog.cpp:2: lib/math.h:2829:36: error: 'isnan' is missing exception specification 'th= row()' _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctool= chain/usr/include/c++/v1/math.h:533:1: note: previous declaration is here isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } ^ This issue can crop up e.g. when trying to build gettext for mingw (which= =20 has got the gnulib isnan function bundled, even if it isn't used). // Martin --8323329-864930931-1566937291=:6969--