public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109814] New: freestanding using cmath does not compile anymore
@ 2023-05-11 15:27 lestofante88 at gmail dot com
  2023-05-11 15:38 ` [Bug libstdc++/109814] " xry111 at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: lestofante88 at gmail dot com @ 2023-05-11 15:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109814

            Bug ID: 109814
           Summary: freestanding using cmath does not compile anymore
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lestofante88 at gmail dot com
  Target Milestone: ---

My code stop compiling after updating from
arm-none-eabi-gcc (Arch Repository) 12.2.0
to
arm-none-eabi-gcc (Arch Repository) 13.1.0
(cant easily test any version in-between)

My understanding is that I am incorrectly using non-freestand library in
freestand mode (cmath in this case).
The problem with this is i am quite sure in embedded a lot of project does. 
This breakage, even if technically correct, may create a lot of issue in
embedded projects and may deserve a special handling, would that be good
communication of the breaking changes, or revert.

REPRODUCE:
- create a file test.cpp containing

#include <cmath>

- compile with 
arm-none-eabi-g++ --freestanding -c test.cpp

RESULT
On gcc 12.2.0: compilation successful
On gcc 13.1.0:

In file included from /usr/arm-none-eabi/include/c++/13.1.0/cmath:41,
                 from test.cpp:1:
/usr/arm-none-eabi/include/c++/13.1.0/bits/requires_hosted.h:34:4: error:
#error "This header is not available in freestanding mode."
   34 | #  error "This header is not available in freestanding mode."
      |    ^~~~~
In file included from /usr/arm-none-eabi/include/c++/13.1.0/bits/specfun.h:47,
                 from /usr/arm-none-eabi/include/c++/13.1.0/cmath:3716:
/usr/arm-none-eabi/include/c++/13.1.0/tr1/gamma.tcc: In function '_Tp
std::__detail::__log_gamma(_Tp)':
/usr/arm-none-eabi/include/c++/13.1.0/tr1/gamma.tcc:236:18: error:
'__throw_domain_error' is not a member of 'std'; did you mean
'__throw_runtime_error'?
  236 |             std::__throw_domain_error(__N("Argument is nonpositive
integer "
      |                  ^~~~~~~~~~~~~~~~~~~~
      |                  __throw_runtime_error

[...] the error repeat for multiple functions.

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

end of thread, other threads:[~2024-05-21  9:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11 15:27 [Bug libstdc++/109814] New: freestanding using cmath does not compile anymore lestofante88 at gmail dot com
2023-05-11 15:38 ` [Bug libstdc++/109814] " xry111 at gcc dot gnu.org
2023-05-11 15:52 ` redi at gcc dot gnu.org
2023-05-11 15:58 ` [Bug libstdc++/109814] [13/14 Regression] " redi at gcc dot gnu.org
2023-05-11 16:00 ` redi at gcc dot gnu.org
2023-05-11 16:48 ` lestofante88 at gmail dot com
2023-05-11 17:43 ` redi at gcc dot gnu.org
2023-05-11 19:22 ` arsen at gcc dot gnu.org
2023-05-11 19:29 ` pinskia at gcc dot gnu.org
2023-05-12 20:04 ` lestofante88 at gmail dot com
2023-05-12 22:34 ` arsen at gcc dot gnu.org
2023-05-16 20:44 ` pinskia at gcc dot gnu.org
2023-07-27  9:26 ` rguenth at gcc dot gnu.org
2023-07-27 10:54 ` redi at gcc dot gnu.org
2023-07-28 10:54 ` arsen at gcc dot gnu.org
2024-05-21  9:15 ` [Bug libstdc++/109814] [13/14/15 " jakub at gcc dot gnu.org

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