Boost C++ Libraries: Ticket #13625: Boost.test fail to compile with -Werror=missing-declarations on some architectures https://svn.boost.org/trac10/ticket/13625 <p> Hello, </p> <p> here is the error code we get: </p> <pre class="wiki">18:07:49 In file included from /opt/boost/include/boost/test/unit_test.hpp:19:0, 18:07:49 from /builds/workspace/SimGrid-Multi/build_mode/ModelChecker/node/simgrid-centos7-x64/build/SimGrid-3.20.90/src/mc/sosp/PageStore_test.cpp:8: 18:07:49 /opt/boost/include/boost/test/unit_test_suite.hpp: In function 'bool init_unit_test()': 18:07:49 /opt/boost/include/boost/test/unit_test_suite.hpp:375:6: error: no previous declaration for 'bool init_unit_test()' [-Werror=missing-declarations] 18:07:49 bool init_unit_test() { 18:07:49 ^~~~~~~~~~~~~~ 18:07:49 cc1plus: all warnings being treated as errors </pre><ul><li>System:: </li></ul><blockquote> <p> Centos7 with Boost 1.67 compiled from sources in /opt. </p> </blockquote> <ul><li>Full logs:: </li></ul><blockquote> <p> <a class="ext-link" href="https://ci.inria.fr/simgrid/job/SimGrid-Multi/build_mode=ModelChecker,node=simgrid-centos7-x64/5662/consoleFull"><span class="icon">​</span>https://ci.inria.fr/simgrid/job/SimGrid-Multi/build_mode=ModelChecker,node=simgrid-centos7-x64/5662/consoleFull</a> </p> </blockquote> <ul><li>Workaround:: </li></ul><blockquote> <p> simply add <code>bool init_unit_test();</code> before including boost/test/unit_test.hpp </p> </blockquote> <p> The weird thing is that the exact same code is compiling like a charm on many other platforms that we test. We saw another instance of this bug back in May 2017, on NetBSD systems where we compiled Boost.test from the sources. At that time, we simply added the workaround described above without too much thinking. </p> <p> Thanks for this great libraries, Mt </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13625 Trac 1.4.3 Raffi Enficiaud Mon, 29 Oct 2018 14:25:32 GMT <link>https://svn.boost.org/trac10/ticket/13625#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13625#comment:1</guid> <description> <p> Hi, </p> <p> I am trying to reproduce this. The header </p> <pre class="wiki">#include &lt;boost/test/unit_test_suite.hpp&gt; </pre><p> that contains the definition of <code>bool init_unit_test();</code> is included at the top of <code>boost/test/unit_test.hpp</code>. </p> <p> I do not quite understand why you are experiencing this error. I do not have access to the logs you mentioned. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 29 Oct 2018 14:26:00 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/13625#comment:2 https://svn.boost.org/trac10/ticket/13625#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> </ul> Ticket Raffi Enficiaud Tue, 30 Oct 2018 08:59:24 GMT <link>https://svn.boost.org/trac10/ticket/13625#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13625#comment:3</guid> <description> <p> I checked the option <code>-Werror=missing-declarations</code> on GCC and clang (apple). With GCC, nothing compiles and with clang everything works well. </p> <p> I believe that enabling this option is a bit annoying as it renders legit C++ to be erroneous. What I can do instead is to add the declaration of <code>init_unit_test</code> (and other variants) such that your code compiles. </p> <p> Would that be ok? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 30 Oct 2018 22:29:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13625#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13625#comment:4</guid> <description> <p> I removed the warning from boost.test instead. See rev <code>972cdd4f367db2f4b3b67521b4259cfa8bf4ba1d</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 06 Nov 2018 19:08:23 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/13625#comment:5 https://svn.boost.org/trac10/ticket/13625#comment:5 <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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.69</span> </li> </ul> Ticket