From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sDXqG85sd19nFQAA0tVLHw (envelope-from ) for ; Fri, 02 Oct 2020 18:09:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qMmyF85sd18JJwAAbx9fmQ (envelope-from ) for ; Fri, 02 Oct 2020 18:09:18 +0000 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 aspmx1.migadu.com (Postfix) with ESMTPS id EF34494042F for ; Fri, 2 Oct 2020 18:09:16 +0000 (UTC) Received: from localhost ([::1]:35800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOPUZ-0003Aa-1r for larch@yhetil.org; Fri, 02 Oct 2020 14:09:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOPSR-0001ni-3m for bug-guix@gnu.org; Fri, 02 Oct 2020 14:07:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOPSQ-0006mV-PB for bug-guix@gnu.org; Fri, 02 Oct 2020 14:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOPSP-0001v6-Ky for bug-guix@gnu.org; Fri, 02 Oct 2020 14:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43579: g++ does not provide std::fegetround Resent-From: Andreas Enge Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 02 Oct 2020 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43579 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Brett Gilio Received: via spool by 43579-submit@debbugs.gnu.org id=B43579.16016619917315 (code B ref 43579); Fri, 02 Oct 2020 18:07:01 +0000 Received: (at 43579) by debbugs.gnu.org; 2 Oct 2020 18:06:31 +0000 Received: from localhost ([127.0.0.1]:42523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPRu-0001tv-QW for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:06:31 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:37320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPRq-0001te-Bt for 43579@debbugs.gnu.org; Fri, 02 Oct 2020 14:06:29 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id EEAE4E6D; Fri, 2 Oct 2020 20:06:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H4UKf86XJs2r; Fri, 2 Oct 2020 20:06:23 +0200 (CEST) Received: from jurong (unknown [IPv6:2001:910:103f::5f8]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DACF0DA3; Fri, 2 Oct 2020 20:06:22 +0200 (CEST) Date: Fri, 2 Oct 2020 20:06:21 +0200 From: Andreas Enge Message-ID: <20201002180621.GA4862@jurong> References: <20200923162121.GA28654@jurong> <87wo0arulv.fsf@gnu.org> <87o8llxsew.fsf@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <87o8llxsew.fsf@debian> X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -0.3 (/) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43579@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: 7VDpIXphVohL --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, On Thu, Oct 01, 2020 at 09:39:35PM -0500, Brett Gilio wrote: > >> The following test file round.cpp does not compile with our g++-10.2.0: > >> #include > >> int main () { > >> return std::fegetround (); > >> } > > > > Could you provide detailed steps to reproduce it? well, just put these lines into a file called "round.cpp" (as attached), and then gcc round.cpp produces round.cpp: In function 'int main()': round.cpp:3:16: error: 'fegetround' is not a member of 'std'; did you mean 'fegetround'? 3 | return std::fegetround (); | ^~~~~~~~~~ In file included from /home/andreas/.guix-profile/include/c++/fenv.h:36, from /home/andreas/.guix-profile/include/c++/cfenv:41, from round.cpp:1: /home/andreas/.guix-profile/include/fenv.h:104:12: note: 'fegetround' declared here 104 | extern int fegetround (void) __THROW __attribute_pure__; | ^~~~~~~~~~ On Thu, Oct 01, 2020 at 09:39:35PM -0500, Brett Gilio wrote: > I believe `std::fegetround` was introduced in C++11, are you using the > appropriate flag? And then you can use any of gcc --std=c++17 round.cpp gcc --std=c++14 round.cpp gcc --std=c++11 round.cpp with the same outcome. The issue https://github.com/fplll/fplll/issues/444 I referenced in my bug report provides more discussion; the outcome was that it is a bug in Guix. I will try to summarise it in the following to make this bug report self-contained; all file and directory names are relative to `guix build gcc-toolchain`. include/c++/cfenv does this around line 41: #if _GLIBCXX_HAVE_FENV_H # include #endif include/c++/fenv.h has this in line 34: #include include/c++/x86_64-unknown-linux-gnu/bits/c++config.h has this around line 28: /* Define if C99 functions in should be imported in in namespace std::tr1. */ /* #undef _GLIBCXX_USE_C99_FENV_TR1 */ And back to include/c++/fenv.h from line 41 on: #if _GLIBCXX_USE_C99_FENV_TR1 #undef feclearexcept #undef fegetexceptflag #undef feraiseexcept #undef fesetexceptflag #undef fetestexcept #undef fegetround #undef fesetround ... namespace std { ... using ::fegetround; using ::fesetround; ... } #endif // _GLIBCXX_USE_C99_FENV_TR1 The difference to the Opensuse headers is that in bits/c++config.h, they define _GLIBCXX_USE_C99_FENV_TR1, which, as I understand it, removes the fe* functions from the global namespace to put them back into the std:: namespace. This should happen somewhere in a configure phase inside the gcc build, but I do not know how to obtain the config.log file easily (short of adding a phase "(const #f)" to the build recipe and doing a "guix build -K"). Andreas --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="round.cpp" #include int main () { return std::fegetround (); } --ikeVEW9yuYc//A+q--