Boost C++ Libraries: Ticket #13285: clang-tidy analyzer complains about uninitialized variable https://svn.boost.org/trac10/ticket/13285 <p> Clang tidy complains about uninitialized variable here: </p> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:169:17: error: 1st function call argument is an uninitialized value [clang-analyzer-core.<a class="missing wiki">CallAndMessage</a>,-warnings-as-errors] </p> <blockquote> <p> _exit_status-&gt;store(code); <sup> </sup></p> </blockquote> <p> /code/core/source/cpp/private/libs/SensorInterface/Velodyne/tests/PacketDecoderTest.cc:96:13: note: Calling constructor for 'child' </p> <blockquote> <p> bp::child call_script(bp::search_path("bash"), get_res_script); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/child.hpp:35:13: note: Calling 'execute_impl' </p> <blockquote> <p> : child(::boost::process::detail::execute_impl(std::forward&lt;Args&gt;(args)...)) {} </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/execute_impl.hpp:275:12: note: Calling 'basic_execute_impl' </p> <blockquote> <p> return basic_execute_impl&lt;req_char_type&gt;( </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/execute_impl.hpp:267:12: note: Calling 'executor::operator()' </p> <blockquote> <p> return exec(); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:312:16: note: Calling 'executor::invoke' </p> <blockquote> <p> return invoke(has_ignore_error(), shall_use_vfork()); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:371:9: note: Assuming the condition is false </p> <blockquote> <p> if (::pipe(p) == -1) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:371:5: note: Taking false branch </p> <blockquote> <p> if (::pipe(p) == -1) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:376:9: note: Assuming the condition is false </p> <blockquote> <p> if (::fcntl(p<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>, F_SETFD, FD_CLOEXEC) == -1) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:376:5: note: Taking false branch </p> <blockquote> <p> if (::fcntl(p<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>, F_SETFD, FD_CLOEXEC) == -1) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:384:5: note: Taking false branch </p> <blockquote> <p> if (_ec) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:391:9: note: Assuming the condition is false </p> <blockquote> <p> if (pid == -1) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:391:5: note: Taking false branch </p> <blockquote> <p> if (pid == -1) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:400:14: note: Assuming the condition is false </p> <blockquote> <p> else if (pid == 0) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:400:10: note: Taking false branch </p> <blockquote> <p> else if (pid == 0) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:428:5: note: Taking true branch </p> <blockquote> <p> if (_ec) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/executor.hpp:431:22: note: Calling '~child' </p> <blockquote> <p> return child(); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:93:13: note: Left side of '&amp;&amp;' is true </p> <blockquote> <p> if (_attached &amp;&amp; !_exited() &amp;&amp; running(ec)) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:93:13: note: Left side of '&amp;&amp;' is true /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:93:40: note: Calling 'child::running' </p> <blockquote> <p> if (_attached &amp;&amp; !_exited() &amp;&amp; running(ec)) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:164:13: note: Left side of '&amp;&amp;' is true </p> <blockquote> <p> if (valid() &amp;&amp; !_exited()) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:164:9: note: Taking true branch </p> <blockquote> <p> if (valid() &amp;&amp; !_exited()) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:166:13: note: 'code' declared without an initial value </p> <blockquote> <p> int code; <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:167:24: note: Calling 'is_running' </p> <blockquote> <p> auto res = boost::process::detail::api::is_running(_child_handle, code, ec); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/is_running.hpp:47:9: note: Assuming the condition is true </p> <blockquote> <p> if (ret == -1) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/is_running.hpp:47:5: note: Taking true branch </p> <blockquote> <p> if (ret == -1) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/is_running.hpp:49:13: note: Assuming the condition is false </p> <blockquote> <p> if (errno != ECHILD) <em>because it no child is running, than this one isn't either, obviously. </em></p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/include/x86_64-linux-gnu/bits/errno.h:54:18: note: expanded from macro 'errno' # define errno (*<span class="underline">errno_location ()) </span></p> <blockquote> <p> <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/posix/is_running.hpp:49:9: note: Taking false branch </p> <blockquote> <p> if (errno != ECHILD) <em>because it no child is running, than this one isn't either, obviously. <sup> </sup></em></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:167:24: note: Returning from 'is_running' </p> <blockquote> <p> auto res = boost::process::detail::api::is_running(_child_handle, code, ec); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:168:17: note: Left side of '&amp;&amp;' is true </p> <blockquote> <p> if (!res &amp;&amp; !_exited()) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:168:13: note: Taking true branch </p> <blockquote> <p> if (!res &amp;&amp; !_exited()) <sup> </sup></p> </blockquote> <p> /usr/local/boost-1.64.0/include/boost/process/detail/child_decl.hpp:169:17: note: 1st function call argument is an uninitialized value </p> <blockquote> <p> _exit_status-&gt;store(code); <sup> </sup></p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13285 Trac 1.4.3