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

--- Comment #5 from David Crocker <dcrocker at eschertech dot com> ---
You seem to be assuming that C++ exceptions can propagate through functions
compiled with a C compiler. On most platforms, they normally cannot, because a
C compiler does not produce the information needed for the C++ unwind mechanism
to unwind the call stack. If you want bsearch and qsort to propagate C++
exceptions, on most platforms the implementations of those functions would have
to be compiled either using a C++ compiler, or with a C compiler using a
special option that tells the compiler to include the tables and/or code needed
to propagate C++ exceptions. Otherwise the exception will end up at
std::unexpected. Maybe bsearch and qsort in newlib are compiled this way, I
haven't checked.

I don't care whether extern "C" functions are to be assumed noexcept by default
or another compiler option is needed to specify that. But without this
facility, the proposed warning will be useless in practice, at least for people
like me writing embedded software.

Reply via email to