unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43579: g++ does not provide std::fegetround
@ 2020-09-23 16:21 Andreas Enge
  2020-09-23 16:36 ` Andreas Enge
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Andreas Enge @ 2020-09-23 16:21 UTC (permalink / raw)
  To: 43579

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





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-01-29 23:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-23 16:21 bug#43579: g++ does not provide std::fegetround Andreas Enge
2020-09-23 16:36 ` 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

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).