This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Mark va_start as nothrow
Jan Hubicka wrote:
> Thinking about this more, the non-call-exceptions and use of any of C++
> standard library is iffy. It is not built with the flag and thus any
> kind of ICE will not be properly handled anyway.
It's not built that way by default. Is it impossible to build it that way?
> One can not resonably
> expect sprintf to produce sane non-call-exception
If you don't control the run-time library, yes, that's true.
> Since -fnon-call-exceptions is really Java thingy, where C++ runtime is
> irrelevant, I am not sure how much better we need to be on builtins.
> If it seems, we can hope for some sanity here, I will add the NCE_LISTs.
People do use it with C and C++, but I don't know how much. I think
va_arg is different from sprintf; va_arg is implemented entirely in bits
we control.
I wasn't sure from Richard's email if he was suggesting just ignoring
throw specifications in the presence of -fnon-call-exceptions. I don't
know exactly what to say about that. My first reaction is that the
exception generated by a memory fault when compiling with
-fnon-call-exceptions should result in a call to std::unexpected if
uncaught with in a region that has a throw-specification that does not
permit the exception.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713