GNU bug report logs - #76090
Regression in gcc-toolchain version 14: C++ header cfenv

Previous Next

Package: guix;

Reported by: Jake <jforst.mailman <at> gmail.com>

Date: Thu, 6 Feb 2025 08:06:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Jake <jforst.mailman <at> gmail.com>
To: 76090 <at> debbugs.gnu.org
Cc: skalman <at> riseup.net, andreas <at> enge.fr, ludo <at> gnu.org, janneke <at> gnu.org
Subject: bug#76090: Regression in gcc-toolchain version 14: C++ header cfenv
Date: Thu, 6 Feb 2025 08:05:25 +0000
[Message part 1 (text/plain, inline)]
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 <at> 14 -- g++ test.cpp && ./a.out
FE_DIVBYZERO is NOT defined

$ guix shell -C gcc-toolchain <at> 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 <at> 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++)
https://issues.guix.gnu.org/43579

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

guix a53bd6f

Thanks!
Jake
[Message part 2 (text/html, inline)]

This bug report was last modified 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.