Regression in gcc-toolchain version 14: C++ header cfenv

  • Open
  • quality assurance status badge
Details
One participant
  • Jake
Owner
unassigned
Submitted by
Jake
Severity
normal

Debbugs page

Jake wrote 1 months ago
(address . bug-guix@gnu.org)(address . skalman@riseup.net)(address . andreas@enge.fr)(address . ludo@gnu.org)(address . janneke@gnu.org)
CAJqVjv8C-6G-2vD2CapphAwM0Zw9FryuiZ2wRdhXpEPEYWRfUA@mail.gmail.com
Hello

With the latest version of gcc-toolchain in Guix (14.2.0), macros from the
<cfenv> header aren't defined during compilation with g++. Version 13 of
gcc-toolchain doesn't have this problem.

Reproducer:

Create a file called test.cpp with contents:

#include <stdio.h>
#include <cfenv>

int main() {
#ifdef FE_DIVBYZERO
printf("FE_DIVBYZERO is defined\n");
#else
printf("FE_DIVBYZERO is NOT defined\n");
#endif

return 0;
}

$ guix shell -C gcc-toolchain@14 -- g++ test.cpp && ./a.out
FE_DIVBYZERO is NOT defined

$ guix shell -C gcc-toolchain@13 -- g++ test.cpp && ./a.out
FE_DIVBYZERO is defined

If we include the C equivalent <fenv.h> instead of <cfenv>, again g++ finds
it in version 13 but not in version 14 of gcc-toolchain.
Note that gcc from gcc-toolchain@14 does find the macro from <fenv.h>
(provided the source file has .c extension).

Other macros from <cfenv> are also affected with g++, including
FE_OVERFLOW, FE_UNDERFLOW, FE_INEXACT, and FE_INVALID.

This bug is probably the same as 43579 (feclearexcept with g++)

I've copied in the members of core-packages team.

guix a53bd6f

Thanks!
Jake
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76090@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76090
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help