unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: 43579@debbugs.gnu.org
Subject: bug#43579: g++ does not provide std::fegetround
Date: Wed, 23 Sep 2020 18:21:21 +0200	[thread overview]
Message-ID: <20200923162121.GA28654@jurong> (raw)

Hello,

this report is related to
   https://github.com/fplll/fplll/issues/444

The following test file round.cpp does not compile with our g++-10.2.0:
#include <cfenv>
int main () {
   return std::fegetround ();
}


Compilation (also when adding "--std=c++11") prints the error:
round.cpp: In function 'int main()':
round.cpp:4:16: error: 'fegetround' is not a member of 'std'; did you mean 'fegetround'?
    4 |    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__;
      |            ^~~~~~~~~~

Compilation succeeds when replacing std::fegetround by fegetround; however,
the former is supposedly part of the C++11 standard.

The culprit is apparently cfenv, which contains the following:
#if _GLIBCXX_HAVE_FENV_H
#include_next <fenv.h>
#endif
#if _GLIBCXX_USE_C99_FENV_TR1
...
#undef fegetround
...
namespace std
{
...
using ::fegetround;
...
}


Our include/c++/x86_64-unknown-linux-gnu/bits/c++config.h has this:
#define _GLIBCXX_HAVE_FENV_H 1
/* Define if C99 functions in <fenv.h> should be imported in <tr1/cfenv> in
namespace std::tr1. */
/* #undef _GLIBCXX_USE_C99_FENV_TR1 */
whereas apparently on other distributions (opensuse, for instance),
_GLIBCXX_USE_C99_FENV_TR1 is defined and leads to std::fesetround being
defined.


And when I look at the build log
   https://ci.guix.gnu.org/log/xpdy9vvqym9xv7praqkwsm3gdzn2kv1p-gcc-10.2.0
for instance, there are the following lines:
checking for ISO C99 support to TR1 in <fenv.h>... no
checking for ISO C99 support to TR1 in <stdint.h>... yes
checking for ISO C99 support to TR1 in <math.h>... yes
checking for ISO C99 support to TR1 in <inttypes.h>... yes
whereas in opensuse, there is
checking for ISO C99 support to TR1 in <fenv.h>... yes

Now it would be interesting to have a look at config.log for gcc...

Andreas





             reply	other threads:[~2020-09-23 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 16:21 Andreas Enge [this message]
2020-09-23 16:36 ` bug#43579: g++ does not provide std::fegetround Andreas Enge
2020-09-23 19:03 ` Ricardo Wurmus
2020-09-23 20:05   ` Andreas Enge
2020-09-23 20:20     ` Andreas Enge
2020-09-23 21:28       ` Ricardo Wurmus
2020-10-01 12:36 ` Ludovic Courtès
2020-10-02  2:39   ` Brett Gilio
2020-10-02 18:06     ` Andreas Enge
2020-10-03 10:02       ` Ludovic Courtès
2020-11-13 17:59         ` Miguel Ángel Arruga Vivas
2021-12-27 21:48 ` Ricardo Wurmus
2022-06-13 17:03 ` bug#43579: Problem still present Andreas Enge
2023-01-29 23:19 ` bug#43579: Sharlatan Hellseher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200923162121.GA28654@jurong \
    --to=andreas@enge.fr \
    --cc=43579@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).