Summary: | dev-qt/qtcore-4.8.6-r2: qglobal.h:1539:22: error: throw will always call terminate() [-Werror=terminate] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Qt Bug Alias <qt> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | jkt |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 582084 | ||
Attachments: |
dev-qt:qtcore-4.8.6-r2:20160928-075801.log
emerge-history.txt environment |
Description
Toralf Förster
2016-09-28 17:04:45 UTC
Created attachment 448302 [details]
dev-qt:qtcore-4.8.6-r2:20160928-075801.log
Created attachment 448304 [details]
emerge-history.txt
Created attachment 448306 [details]
environment
Caused by CXXFLAGS="-Werror=terminate". You're not supposed to add this kind of things to your build flags. (In reply to Davide Pesavento from comment #4) > Caused by CXXFLAGS="-Werror=terminate". You're not supposed to add this kind > of things to your build flags. I purposely told Toralf to add this flag, in order to catch cases where throw/noexcept semantics have changed (silently) between GCC 5 and GCC 6: https://gcc.gnu.org/gcc-6/porting_to.html If you're willing to ignore this, you risk runtime failures, as the exceptions won't be caught anymore and std::terminate() will be called. Your choice, tread carefully. My TL;DR: code which triggers this is already broken. (In reply to David Seifert from comment #5) > I purposely told Toralf to add this flag, in order to catch cases where > throw/noexcept semantics have changed (silently) between GCC 5 and GCC 6: > https://gcc.gnu.org/gcc-6/porting_to.html If you're willing to ignore this, > you risk runtime failures, as the exceptions won't be caught anymore and > std::terminate() will be called. Your choice, tread carefully. The warning in question comes from a QObject::~QObject where it attempts to catch exceptions thrown by slots connected to QObject::destroyed. In my humble opinion (I'm a mere Qt contributor with no upstream affiliation except a few patches), doing that *and* expecting the destructors to propagate exceptions through ~QObject is... futile. Any code which does that is effectively broken (and would be broken by USE=-exceptions, anyway). The GCC change is a change from one C++ standard to another. My professional opinion is that it is a bad idea to compile ancient code designed with an old standard in mind against a new standard. There is always a chance to see breakage, and if upstream doesn't care about newer GCC standards, maybe we shouldn't force that upon them. This is *not* a distro-wide choice (unlike the choice of the libstdc++'s ABI). You might want to patch this, sure. However, please note that this bug doesn't mean "ZOMG undefined behavior". It means that the application will now suddenly terminate() if and only if the following criteria are met: - a slot connected to QObject::terminate throws an exception, - the original object is not destroyed during stack unwinding as a result of another exception, - USE=exceptions. In my professional experience, code doing that is broken. (In reply to David Seifert from comment #5) > (In reply to Davide Pesavento from comment #4) > > Caused by CXXFLAGS="-Werror=terminate". You're not supposed to add this kind > > of things to your build flags. > > I purposely told Toralf to add this flag, in order to catch cases where > throw/noexcept semantics have changed (silently) between GCC 5 and GCC 6: > https://gcc.gnu.org/gcc-6/porting_to.html If you're willing to ignore this, > you risk runtime failures, as the exceptions won't be caught anymore and > std::terminate() will be called. Your choice, tread carefully. We're going to force building Qt4 with -std=gnu++98 because it fails with C++11/14 in any case, so the above doesn't apply. |