public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Federico Lenarduzzi <federico.lenarduzzi@tallertechnologies.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Fix exceptions being generated when compiling with -fno-exceptions
Date: Wed, 15 Apr 2015 14:15:00 -0000	[thread overview]
Message-ID: <CAGVZXp9vUV801HGVV9ekC4xfH671UUWJ9=MTwbb8iVDMsHzrfg@mail.gmail.com> (raw)

Thanks for comments.

I forgot to mention that this change came of working with the target
fragment file
for the generation of libraries with and without exceptions. After that, the
choice of the multilibs with or without exceptions will depend on the use the
-fno-excepcions flag at the moment of compilation of an application.

As you mentioned in the thread linked to this new flag, have the option
--disable-libstdcxx-verbose is very useful, especially in embedded software
development.

Now, If I have the below case: I'm developing two applications, the first not
want to have exception handling, therefore I would like to have the library
without verbose_terminate_handler () function and the second application handles
exceptions, with which I would like to have the library with the function
mentioned above.

To achieve this, I should have two copies compiled in different ways or
recompile all gcc to enable or disable this function.

The idea of this patch is that using this function not depends from a
configuration
flag but depends of a flag which participates in the selection of the
correct multilib.

I think it could be discuss, I would like read some opinions and
comments about this.



2015-04-14 16:27 GMT-03:00 Jonathan Wakely <jwakely.gcc@gmail.com>:

> On 14 April 2015 at 16:17, Federico Lenarduzzi wrote:
> > When the libstdc++ is compiled, the compiler sets the std::terminate_handler function with __verbose_terminate_handler() or std::abort() depending on _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE being true or false.
> >
> > However, even if we compile with -fno-exceptions, the compiler will use __verbose_terminate_handler(), which uses exceptions. Therefore, the library is not fully exception-free.
>
> I guess this makes sense, but you can just build with
> --disable-libstdcxx-verbose to have the same effect.
>
> > It also makes std::uncaught_exception() throw() return false if __EXCEPTIONS is not defined.
>
> This part seems like a good idea, but we'll also need to do it to the
> new uncaught_exceptions() function about to be added, so let's wait
> until that in committed first (which will be shortly after the 5.1
> release).
>
> The checks should use __cpp_exceptions not __EXCEPTIONS, see the current trunk.




-- 
Federico Lenarduzzi
Software Engineer

Taller Technologies Argentina
San Lorenzo 47, 3rd Floor, Office 5
Cordoba, Argentina
Phone: +54 351 4220701
Mobile: +54 358 4289083
Skype: federico.lenarduzzi1







-- 
Federico Lenarduzzi
Software Engineer

Taller Technologies Argentina
San Lorenzo 47, 3rd Floor, Office 5
Cordoba, Argentina
Phone: +54 351 4220701
Mobile: +54 358 4289083
Skype: federico.lenarduzzi1

             reply	other threads:[~2015-04-15 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 14:15 Federico Lenarduzzi [this message]
2015-04-15 14:56 ` Jonathan Wakely
2015-04-16 14:21   ` Federico Lenarduzzi
2015-04-16 14:33     ` Jonathan Wakely
  -- strict thread matches above, loose matches on Subject: below --
2015-04-14 15:18 Federico Lenarduzzi
2015-04-14 19:27 ` Jonathan Wakely
2015-04-27 21:06 ` Jonathan Wakely

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='CAGVZXp9vUV801HGVV9ekC4xfH671UUWJ9=MTwbb8iVDMsHzrfg@mail.gmail.com' \
    --to=federico.lenarduzzi@tallertechnologies.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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).