public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lestofante88 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/109814] New: freestanding using cmath does not compile anymore
Date: Thu, 11 May 2023 15:27:53 +0000	[thread overview]
Message-ID: <bug-109814-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2023-05-11 15:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 15:27 lestofante88 at gmail dot com [this message]
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

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

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

  git send-email \
    --in-reply-to=bug-109814-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.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.
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).