Boost C++ Libraries: Ticket #7642: archive::archive_exception fails to build when using C++11 with gcc 4.7.2 https://svn.boost.org/trac10/ticket/7642 <p> The destructors no throw specifier 'throw ()' appears not be be inherited properly for some classes derived from archive::archive_exception. A temporary workaround was to remove the 'throw ()' specification for gcc 4.7.2 compilation. </p> <p> Build log output. </p> <blockquote> <p> "QCC" -Wc,-ftemplate-depth-128 -DFD_SETSIZE=2048 -march=k8-sse3 -mtune=k8-sse3 -mmmx -msse3 -mfpmath=sse -mno-3dnow -mstackrealign -Y_cpp -Wc,-fPIC,-fnothrow-opt,-std=c++11,-std=gnu++11 -O3 -Wc,-finline-functions -Wc,-Wno-inline -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "D:\boostBuild_QCC_1_52_0\boost\bin.v2\libs\serialization\build\qcc\release\link-static\target-os-qnxnto\threadapi-pthread\threading-multi\xml_iarchive.o" "libs\serialization\src\xml_iarchive.cpp" </p> </blockquote> <p> ...failed qcc.compile.c++ D:\boostBuild_QCC_1_52_0\boost\bin.v2\libs\serialization\build\qcc\release\link-static\target-os-qnxnto\threadapi-pthread\threading-multi\xml_iarchive.o... qcc.compile.c++ D:\boostBuild_QCC_1_52_0\boost\bin.v2\libs\serialization\build\qcc\release\link-static\target-os-qnxnto\threadapi-pthread\threading-multi\xml_archive_exception.o In file included from libs\serialization\src\xml_archive_exception.cpp:21:0: ./boost/archive/xml_archive_exception.hpp:35:44: error: looser throw specifier for 'virtual boost::archive::xml_archive_exception::~xml_archive_exception()' In file included from ./boost/archive/xml_archive_exception.hpp:25:0, </p> <blockquote> <p> from libs\serialization\src\xml_archive_exception.cpp:21: </p> </blockquote> <p> ./boost/archive/archive_exception.hpp:86:5: error: overriding 'virtual boost::archive::archive_exception::~archive_exception() throw ()' cc: d:/qnxsdk/qnxsdk6.5-001/host/win32/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.7.2/cc1plus caught signal 1 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7642 Trac 1.4.3 Robert Ramey Tue, 06 Nov 2012 19:00:20 GMT <link>https://svn.boost.org/trac10/ticket/7642#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:1</guid> <description> <p> I've investigated this and some things occur to me. </p> <p> a) I'm suspecting that this some sort of compiler/library quirk related to qcc compiler. I say this because our text matrix shows problems with this compiler and the serialization library. </p> <p> b) I don't see virtual boost::archive::archive_exception::~archive_exception() throw (); on line 86 of boost/archive/archive_exception.hpp:86: What I DO see is ~archive_exception(); which looks fine to me. </p> <p> c) Another thing I see is: class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : </p> <blockquote> <p> public virtual std::exception </p> </blockquote> <p> { on line 44 of boost/archive/archive_exception.hpp: This raises a couple of issues: </p> <p> 1) Why did I put "virtual" there. This would be to conflate base classes when the exception is part of a multiple inheritance hierarchy. Perhaps not a bad idea. But I doubt that it's used by anyone. </p> <p> 2)I looks to me that the compiler is using this to mean that all functions are virtual? One can only guess. </p> <p> I would try commenting out the "virtual" inheritance and see if that fixes things. Since I don't have this compiler, this would fall to you. I would also much appreciate it if you used tools/regression/src/library_test.sh to run ALL the serialization library tests after making this change and let me know what happens. Meanwhile, I'll leave this pending. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>steven.lemay@…</author> <pubDate>Tue, 06 Nov 2012 22:06:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:2</guid> <description> <p> I restored the original code and only removed the misplaced 'virtual' as described in item c) on line 44 boost/archive/archive_exception.hpp. Boost::serialization now builds WITHOUT the errors previously described. </p> <p> Now consider xml_archive_exception.hpp line 35-36: </p> <p> class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception : </p> <blockquote> <p> public <strong>virtual</strong> boost::archive::archive_exception </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>steven.lemay@…</author> <pubDate>Wed, 07 Nov 2012 18:37:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:3</guid> <description> <p> I'm new to Boost, and especially the included regression test system. I'm not having much luck executing the suggested test on our Windows hosted cross-compile environment for QNX RTOS. Even running the provided batch file for the Windows 7/VS2012 build doesn't seem to work off-the-shelf. Hopefully, I can better verify the change once I figure this out (or what I'm doing wrong to execute the test). Sorry for the delay. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 07 Nov 2012 19:03:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:4</guid> <description> <p> First of all - thanks for making this effort. I realize it's much harder than it should be. </p> <p> Here is some advice. Use the procedure described in </p> <p> <a href="http://www.boost.org/doc/libs/1_52_0/tools/regression/doc/library_status.html">http://www.boost.org/doc/libs/1_52_0/tools/regression/doc/library_status.html</a> </p> <p> This will permit you to just test your changes in the serialization library without having to test the whole of boost. This still takes a while - over an hour - but it's doable. </p> <p> Note that this required the building of the library_status and process_jam_log executables. Contrary to the information on the page sited above, the bjam command to do this would be: </p> <p> bjam toolset=&lt;your compiler here!&gt; library_status process_jam_log </p> <p> This is required because the Jamfile in the .../tools/regression/build/Jamfile doesn't build these two executable by default - you have to explicitly state them as targets. </p> <p> Good Luck with this. and thanks again. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 08 Nov 2012 16:16:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:5</guid> <description> <p> Are you able to perform these test operations with Visual Studio <a class="changeset" href="https://svn.boost.org/trac10/changeset/2012" title="stylistic corrections ">[2012]</a>? I am having little success. I must be missing some fundamental step or configuration. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 09 Nov 2012 01:35:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:6</guid> <description> <p> I haven't tried vs 2012. But I'm pretty confident things will work. </p> <p> The question is: have you been able to get the bjam and related tools up and running? That's the key. This might entail: </p> <p> fixing up user-config.jam in regression/tools/... making sure your command line compiler works. I had to make batch file in my program files to make make this work. </p> <p> compile process_jam_log and library_status and move the executables to some directory in the path. </p> <p> Finally: </p> <p> move to BOOST_ROOT/libs/serialization/test </p> <p> invoke ../../../regression/test/library_test.bat (or sh) and follow the instructions there. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sat, 17 Nov 2012 17:27:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:7</guid> <description> <p> I've been looking int to this somewhat. Mostly into why I used the "virtual" in the first place. I'm guessing that this was due to the advice offered in <a href="http://www.boost.org/community/error_handling.html">http://www.boost.org/community/error_handling.html</a> which you might want to look at. Based on this I would be inclined to leave in the "virtual" for the normal case - but eliminated for the offending situation. I believe that this problem only occurs with the QCC compiler. Maybe you have a little more information you can share about this. I don't know if there is a boost config macro which can detect this problem so we can work around it in a more definitive manner. </p> <p> Still looking at this. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 17 Nov 2012 20:29:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:8</guid> <description> <p> I looked at this some more and concluded that the best fix is to remove the "throw()" from the archive exception constructors and destructores. </p> <p> a) They weren't really correct in the first place. b) constructors / destructors shouldn't ever throw anyhow c) I believe that this will fix your issue. </p> <p> The change will be chacked in the trunk in a few days after I can run tests on my local system. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>tvaneerd@…</author> <pubDate>Mon, 19 Nov 2012 21:08:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:9</guid> <description> <p> by the way, QCC is just a simple wrapper around gcc. The same bug should happen with gcc with the same compiler flags set. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 12 Dec 2012 21:57:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7642#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7642#comment:10</guid> <description> <p> I believe I've addressed this. </p> <p> I've checked in changes to the trunk. Please verify if this problem isn't solved. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 06 Feb 2013 20:41:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7642#comment:11 https://svn.boost.org/trac10/ticket/7642#comment:11 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket