{"id":311665,"date":"2020-10-19T09:00:25","date_gmt":"2020-10-19T09:00:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311665"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311665","title":{"rendered":"\u0410\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 DeepSpeech \u0438\u043b\u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 namespace std"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/524026\/\">DeepSpeech \u2013 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Mozilla. \u0414\u0432\u0438\u0436\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043e\u0442\u0437\u044b\u0432\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043c\u0438\u0448\u0435\u043d\u044c\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 C++-\u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 DeepSpeech. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5ad\/5d0\/076\/5ad5d0076af2293cc7c41dc5db49f05b.png\" alt=\"image1.png\"><\/div>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043a\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0438 <a href=\"https:\/\/github.com\/mozilla\/DeepSpeech\">DeepSpeech<\/a> \u043d\u0435 \u0441\u0442\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c. \u041d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c: \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 15k \u0437\u0432\u0451\u0437\u0434 \u043d\u0430 GitHub.<\/p>\n<p>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430 PVS-Studio.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b DeepSpeech \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 TensorFlow. \u042f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e \u043d\u0435\u0451 \u043c\u044b \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/www.viva64.com\/ru\/b\/0497\/\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0421 \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e? \u041e\u0448\u0438\u0431\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u0432 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435\u0433\u043e, \u043d\u043e \u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/www.viva64.com\/ru\/b\/0762\/\">\u0432 \u043d\u0430\u0448\u0435\u0439 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u2013 \u043f\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043e\u0448\u0438\u0431\u043e\u043a. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0448\u043b\u0438 \u0441\u044e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u0439 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 (\u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 namespace std) \u2013 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0430\u043c \u0432\u0430\u0441 \u0436\u0434\u0451\u0442 \u043f\u043e-\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440!<\/p>\n<h2>\u041e\u0431\u0437\u043e\u0440 10 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/h2>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 1<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v773\/\">V773<\/a> The function was exited without releasing the &#39;data&#39; pointer. A memory leak is possible. edit-fst.h 311<\/p>\n<pre><code class=\"cpp\">\/\/ EditFstData method implementations: just the Read method. template &lt;typename A, typename WrappedFstT, typename MutableFstT&gt; EditFstData&lt;A, WrappedFstT, MutableFstT&gt; * EditFstData&lt;A, WrappedFstT, MutableFstT&gt;::Read(std::istream &amp;strm,                                                const FstReadOptions &amp;opts) {   auto *data = new EditFstData&lt;A, WrappedFstT, MutableFstT&gt;();   \/\/ next read in MutabelFstT machine that stores edits   FstReadOptions edits_opts(opts);    ....      std::unique_ptr&lt;MutableFstT&gt; edits(MutableFstT::Read(strm, edits_opts));   if (!edits) return nullptr; \/\/ &lt;=    .... }<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438: \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>Read<\/i> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 &#39;<i>return nullptr<\/i>&#39;, \u043d\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f &#39;<i>new EditFstData<\/i>&#39;. \u041f\u0440\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 <i>delete data<\/i>) \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0451\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0430 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0432\u044b\u0437\u0432\u0430\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043b\u044c\u0437\u044f. <\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443: \u0432 \u043a\u043e\u0434\u0435 \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u0430\u043a \u0441 \u0443\u043c\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u0438 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0431\u044b <i>data<\/i> \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0443\u043c\u043d\u044b\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c, \u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e: \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043c\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 2<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v1062\/\">V1062<\/a> The &#39;DfsState&#39; class defines a custom &#39;new&#39; operator. The &#39;delete&#39; operator must also be defined. dfs-visit.h 62<\/p>\n<pre><code class=\"cpp\">\/\/ An FST state&#39;s DFS stack state. template &lt;class FST&gt; struct DfsState { public:   ....   void *operator new(size_t size,                       MemoryPool&lt;DfsState&lt;FST&gt;&gt; *pool) {     return pool-&gt;Allocate();   }   .... }<\/code><\/pre>\n<p>  PVS-Studio \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043f\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u2013 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043d\u0451\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0432\u0435\u0436\u0435\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c <a href=\"https:\/\/www.viva64.com\/ru\/w\/v1062\/\">V1062<\/a>.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0438\u0442 \u044d\u0442\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430, \u043f\u0440\u043e\u0441\u0442\u043e: \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#39;new&#39;, \u0442\u043e \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#39;delete&#39;. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 &#39;delete&#39;, \u0442\u043e \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 &#39;new&#39; \u0442\u043e\u0436\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c.<\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043e: \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 &#39;new&#39;, \u0430 \u0443\u0434\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u2013 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c &#39;delete&#39;. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>Allocate<\/i> \u043a\u043b\u0430\u0441\u0441\u0430 <i>MemoryPool<\/i>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 &#39;new&#39;:<\/p>\n<pre><code class=\"cpp\">void *Allocate() {   if (free_list_ == nullptr) {     auto *link = static_cast&lt;Link *&gt;(mem_arena_.Allocate(1));     link-&gt;next = nullptr;     return link;   } else {     auto *link = free_list_;     free_list_ = link-&gt;next;     return link;   } }<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a. \u041b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u0443\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c &#39;new&#39;. <\/p>\n<p>  \u041d\u043e \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435-\u043a\u0430! \u041f\u0440\u044f\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0438\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">void Free(void *ptr) {   if (ptr) {     auto *link = static_cast&lt;Link *&gt;(ptr);     link-&gt;next = free_list_;     free_list_ = link;   } }<\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442, \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0430\u043a \u0434\u043b\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#39;delete&#39;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>Free()<\/i>.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0435\u0449\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/w\/V1062\/\">V1062<\/a> The &#39;VectorState&#39; class defines a custom &#39;new&#39; operator. The &#39;delete&#39; operator must also be defined. vector-fst.h 31<\/li>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/w\/V1062\/\">V1062<\/a> The &#39;CacheState&#39; class defines a custom &#39;new&#39; operator. The &#39;delete&#39; operator must also be defined. cache.h 65<\/li>\n<\/ul>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 3<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v703\/\">V703<\/a> It is odd that the &#39;first_path&#39; field in derived class &#39;ShortestPathOptions&#39; overwrites field in base class &#39;ShortestDistanceOptions&#39;. Check lines: shortest-path.h:35, shortest-distance.h:34. shortest-path.h 35<\/p>\n<pre><code class=\"cpp\">\/\/ Base class template &lt;class Arc, class Queue, class ArcFilter&gt; struct ShortestDistanceOptions {   Queue *state_queue;    \/\/ Queue discipline used; owned by caller.   ArcFilter arc_filter;  \/\/ Arc filter (e.g., limit to only epsilon graph).   StateId source;        \/\/ If kNoStateId, use the FST&#39;s initial state.   float delta;           \/\/ Determines the degree of convergence required   bool first_path;       \/\/ For a semiring with the path property (o.w.                          \/\/ undefined), compute the shortest-distances along                          \/\/ along the first path to a final state found                          \/\/ by the algorithm. That path is the shortest-path                          \/\/ only if the FST has a unique final state (or all                          \/\/ the final states have the same final weight), the                          \/\/ queue discipline is shortest-first and all the                          \/\/ weights in the FST are between One() and Zero()                          \/\/ according to NaturalLess.    ShortestDistanceOptions(Queue *state_queue, ArcFilter arc_filter,                           StateId source = kNoStateId,                           float delta = kShortestDelta)       : state_queue(state_queue),         arc_filter(arc_filter),         source(source),         delta(delta),         first_path(false) {} }; \/\/ Derived class template &lt;class Arc, class Queue, class ArcFilter&gt; struct ShortestPathOptions     : public ShortestDistanceOptions&lt;Arc, Queue, ArcFilter&gt; {   using StateId = typename Arc::StateId;   using Weight = typename Arc::Weight;    int32 nshortest;    \/\/ Returns n-shortest paths.   bool unique;        \/\/ Only returns paths with distinct input strings.   bool has_distance;  \/\/ Distance vector already contains the                       \/\/ shortest distance from the initial state.   bool first_path;    \/\/ Single shortest path stops after finding the first                       \/\/ path to a final state; that path is the shortest path                       \/\/ only when:                       \/\/ (1) using the ShortestFirstQueue with all the weights                       \/\/ in the FST being between One() and Zero() according to                       \/\/ NaturalLess or when                       \/\/ (2) using the NaturalAStarQueue with an admissible                       \/\/ and consistent estimate.   Weight weight_threshold;  \/\/ Pruning weight threshold.   StateId state_threshold;  \/\/ Pruning state threshold.    ShortestPathOptions(Queue *queue, ArcFilter filter, int32 nshortest = 1,                       bool unique = false, bool has_distance = false,                       float delta = kShortestDelta, bool first_path = false,                       Weight weight_threshold = Weight::Zero(),                       StateId state_threshold = kNoStateId)       : ShortestDistanceOptions&lt;Arc, Queue, ArcFilter&gt;(queue, filter,                                                        kNoStateId, delta),         nshortest(nshortest),         unique(unique),         has_distance(has_distance),         first_path(first_path),         weight_threshold(std::move(weight_threshold)),         state_threshold(state_threshold) {} };<\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u043d\u0435 \u0442\u0430\u043a-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u0432\u0435\u0440\u043d\u043e?<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0439, \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u043e\u043b\u044f \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438: <i>first_path<\/i>. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0434\u0440\u0443\u0433\u043e\u0435 \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0432\u043e\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0439 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u044f \u0438\u043c\u0435\u044e \u0432\u0432\u0438\u0434\u0443, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">class U { public:   int x; };  class V : public U { public:   int x;  \/\/ &lt;= V703 here   int z; };<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438\u043c\u044f <i>x<\/i> \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434?<\/p>\n<pre><code class=\"cpp\">int main() {   V vClass;   vClass.x = 1;   U *uClassPtr = &amp;vClass;   std::cout &lt;&lt; uClassPtr-&gt;x &lt;&lt; std::endl;   .... }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0432\u044b \u043f\u0440\u0430\u0432\u044b. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u0432 \u043f\u043e\u043b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u0432\u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432\u0441\u0451 \u0435\u0449\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043c\u0435\u043d \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u2013 \u044d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \ud83d\ude42<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 4<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v1004\/\">V1004<\/a> The &#39;aiter&#39; pointer was used unsafely after it was verified against nullptr. Check lines: 107, 119. visit.h 119<\/p>\n<pre><code class=\"cpp\">template &lt;....&gt; void Visit(....) {   ....   \/\/ Deletes arc iterator if done.   auto *aiter = arc_iterator[state];   if ((aiter &amp;&amp; aiter-&gt;Done()) || !visit) {     Destroy(aiter, &amp;aiter_pool);     arc_iterator[state] = nullptr;     state_status[state] |= kArcIterDone;   }   \/\/ Dequeues state and marks black if done.   if (state_status[state] &amp; kArcIterDone) {     queue-&gt;Dequeue();     visitor-&gt;FinishState(state);     state_status[state] = kBlackState;     continue;   }   const auto &amp;arc = aiter-&gt;Value();       \/\/ &lt;=   .... }<\/code><\/pre>\n<p>  \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <i>aiter<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043d\u0430 <i>nullptr<\/i>. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435: \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <i>nullptr<\/i>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u043b\u0435\u0434\u0438\u043c, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441 <i>aiter<\/i>, \u0435\u0441\u043b\u0438 \u043e\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 &#39;<i>if ((aiter &amp;&amp; aiter-&gt;Done()) || !visit)<\/i>&#39;. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f <i>false<\/i>, \u0438 \u0432 then-\u0432\u0435\u0442\u0432\u044c \u044d\u0442\u043e\u0433\u043e <i>if<\/i> \u043c\u044b \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u043c. \u0410 \u0434\u0430\u043b\u044c\u0448\u0435, \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0430\u043d\u043e\u043d\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f: &#39;<i>aiter-&gt;Value();<\/i>&#39;. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 5<\/b><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/w\/v595\/\">V595<\/a> The &#39;istrm&#39; pointer was utilized before it was verified against nullptr. Check lines: 60, 61. mapped-file.cc 60<\/li>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/w\/v595\/\">V595<\/a> The &#39;istrm&#39; pointer was utilized before it was verified against nullptr. Check lines: 39, 61. mapped-file.cc 39<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"cpp\">MappedFile *MappedFile::Map(std::istream *istrm, bool memorymap,                             const string &amp;source, size_t size) {   const auto spos = istrm-&gt;tellg();        \/\/ &lt;=   ....   istrm-&gt;seekg(pos + size, std::ios::beg); \/\/ &lt;=   if (istrm) {                             \/\/ &lt;=     VLOG(1) &lt;&lt; &quot;mmap&#39;ed region of &quot; &lt;&lt; size             &lt;&lt; &quot; at offset &quot; &lt;&lt; pos             &lt;&lt; &quot; from &quot; &lt;&lt; source             &lt;&lt; &quot; to addr &quot; &lt;&lt; map;   return mmf.release();   }   .... }<\/code><\/pre>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0430, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0430\u044f \u0437\u0434\u0435\u0441\u044c, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0447\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <i>istrm<\/i> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u0434\u0432\u0430 \u0440\u0430\u0437\u0430), \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043d\u043e\u043b\u044c \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u042d\u0442\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442: \u0435\u0441\u043b\u0438 \u0432 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <i>istrm<\/i> \u043f\u0440\u0438\u0434\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0442\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (\u0438\u043b\u0438, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b) \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435\u043f\u043e\u0440\u044f\u0434\u043e\u043a\u2026 \u0442\u0430\u043a\u0438\u0435 \u0431\u0430\u0433\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/299\/d86\/22e\/299d8622eecc957c651b91d981d30856.png\" alt=\"image2.png\"><\/div>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 6<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v730\/\">V730<\/a> Not all members of a class are initialized inside the constructor. Consider inspecting: stones_written_. ersatz_progress.cc 14<\/p>\n<pre><code class=\"cpp\">ErsatzProgress::ErsatzProgress()   : current_(0)   , next_(std::numeric_limits&lt;uint64_t&gt;::max())   , complete_(next_)   , out_(NULL) {}<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043d\u0430\u0441, \u0447\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <i>ErzatzProgress<\/i>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u043e\u043b\u0435\u0439 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">class ErsatzProgress {   .... private:     void Milestone();      uint64_t current_, next_, complete_;     unsigned char stones_written_;     std::ostream *out_; };<\/code><\/pre>\n<p>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u043a\u0440\u043e\u043c\u0435 <i>stones_written_<\/i>.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/i>: \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043b\u0438\u0448\u044c \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0431\u0443\u0434\u0435\u0442 <i>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e<\/i>. <\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/www.viva64.com\/ru\/w\/v730\/\">V730<\/a> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0437\u0430\u0431\u043b\u0430\u0433\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u0435\u0434\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0435\u0448\u0438\u043b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0443 \u043d\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435 \u0431\u0435\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f?<\/p>\n<p>  \u041c\u043e\u0438 \u0434\u043e\u0433\u0430\u0434\u043a\u0438 \u043d\u0430\u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 <i>stones_written_<\/i> \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0435, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0438\u0441\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0438\u0436\u0435 \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:<\/p>\n<pre><code class=\"cpp\">ErsatzProgress::ErsatzProgress(uint64_t complete,                                std::ostream *to,                                const std::string &amp;message)   : current_(0)   , next_(complete \/ kWidth)   , complete_(complete)   , stones_written_(0)   , out_(to) {   .... }<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442: \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0431\u044b\u043b \u043f\u0440\u043e \u043e\u0434\u043d\u043e.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 7<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v780\/\">V780<\/a> The object &#39;&amp; params&#39; of a non-passive (non-PDS) type cannot be initialized using the memset function. binary_format.cc 261<\/p>\n<pre><code class=\"cpp\">\/* Not the best numbering system,    but it grew this way for historical reasons  * and I want to preserve existing binary files. *\/ typedef enum {   PROBING=0,   REST_PROBING=1,   TRIE=2,   QUANT_TRIE=3,   ARRAY_TRIE=4,   QUANT_ARRAY_TRIE=5 } ModelType;  ....  struct FixedWidthParameters {   unsigned char order;   float probing_multiplier;   \/\/ What type of model is this?   ModelType model_type;   \/\/ Does the end of the file    \/\/ have the actual strings in the vocabulary?   bool has_vocabulary;   unsigned int search_version; };  ....  \/\/ Parameters stored in the header of a binary file. struct Parameters {   FixedWidthParameters fixed;   std::vector&lt;uint64_t&gt; counts; };  ....  void BinaryFormat::FinishFile(....) {   ....   \/\/ header and vocab share the same mmap.   Parameters params = Parameters();   memset(&amp;params, 0, sizeof(Parameters)); \/\/ &lt;=   .... }<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 PDS-\u0442\u0438\u043f. \u0410\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0430 &quot;PDS&quot; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;Passive Data Structure&quot; \u2013 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043c\u0435\u0441\u0442\u043e &quot;PDS&quot; \u0433\u043e\u0432\u043e\u0440\u044f\u0442 &quot;POD&quot; \u2013 &quot;Plain Old Data&quot;. \u0413\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c (\u0446\u0438\u0442\u0438\u0440\u0443\u044e \u0441 \u0440\u0443\u0441\u0441\u043a\u043e\u0439 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%BE%D1%81%D1%82%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438<\/a>), PDS-\u0442\u0438\u043f \u2013 \u044d\u0442\u043e \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0436\u0451\u0441\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0413\u043e\u0432\u043e\u0440\u044f \u0435\u0449\u0435 \u043f\u0440\u043e\u0449\u0435, \u044d\u0442\u043e \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432.<\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e POD-\u0442\u0438\u043f\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u044e (memset, memcpy \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435). \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e &quot;\u043d\u0435-PDS&quot; \u0442\u0438\u043f\u044b \u0442\u0430\u043a\u043e\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f: \u0441\u0442\u043e\u043b\u044c \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0441 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a \u0443\u0442\u0435\u0447\u043a\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u0432\u043e\u0439\u043d\u043e\u043c\u0443 \u043e\u0447\u0438\u0449\u0435\u043d\u0438\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438\u043b\u0438 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u041d\u0430 \u043a\u043e\u0434, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, PVS-Studio \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: \u0442\u0430\u043a \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0442\u0438\u043f\u0430 <i>Parameters<\/i> \u043d\u0435\u043b\u044c\u0437\u044f. \u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0435\u0451 \u0447\u043b\u0435\u043d \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <i>std::vector<\/i>. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0417\u0430\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>memset<\/i> \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 8<\/b><\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v575\/\">V575<\/a> The potential null pointer is passed into &#39;memcpy&#39; function. Inspect the first argument. Check lines: 73, 68. modelstate.cc 73<\/p>\n<pre><code class=\"cpp\">Metadata* ModelState::decode_metadata(const DecoderState&amp; state,                              size_t num_results) {   ....   Metadata* ret = (Metadata*)malloc(sizeof(Metadata));   ....   memcpy(ret, &amp;metadata, sizeof(Metadata));   return ret; }<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>memcpy<\/i> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0414\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>malloc<\/i> \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 <i>NULL<\/i>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>memset<\/i>, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u2013 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0444\u0435\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0448\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043c\u0443\u0442\u0438\u0442\u044c\u0441\u044f: \u0435\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c\/\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e <i>malloc<\/i> \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0442\u043e \u043d\u0435 \u0432\u0441\u0451 \u043b\u0438 \u0440\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435? \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0442\u0430\u043a \u0438 \u0442\u0430\u043a \u0443\u043f\u0430\u0434\u0451\u0442, \u0432\u0435\u0434\u044c \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u043d\u0430 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. <\/p>\n<p>  \u041c\u044b \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u043c\u043d\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e. \u042f \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u0432\u0430\u043c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u043d\u043e \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0435\u0451 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \ud83d\ude42 \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u0430 <i>malloc<\/i>, \u0442\u043e \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u0432\u0430\u0441 \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e: <a href=\"https:\/\/www.viva64.com\/ru\/b\/0558\/\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f malloc<\/a>.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 9<\/b><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u0442\u0435\u043c\u0438 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0447\u0442\u043e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435. \u041f\u0440\u0430\u0432\u0434\u0430, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v769\/\">V769<\/a> The &#39;middle_begin_&#39; pointer in the &#39;middle_begin_ + (counts.size() \u2014 2)&#39; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 553, 552. search_trie.cc 553<\/p>\n<pre><code class=\"cpp\">template &lt;class Quant, class Bhiksha&gt; class TrieSearch { .... private:   ....   Middle *middle_begin_, *middle_end_;   .... };  template &lt;class Quant, class Bhiksha&gt; uint8_t *TrieSearch&lt;Quant, Bhiksha&gt;::SetupMemory(....) {   ....   middle_begin_     = static_cast&lt;Middle*&gt;(malloc(sizeof(Middle) * (counts.size() - 2)));   middle_end_ = middle_begin_ + (counts.size() - 2);   .... }<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>malloc<\/i>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <i>nullptr<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u0423\u0432\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0438 \u0432 \u043f\u043e\u043b\u0435 <i>middle_end_<\/i> \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 10<\/b><\/p>\n<p>  \u041d\u0443 \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 kenlm, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0432 DeepSpeech: <\/p>\n<p>  <a href=\"https:\/\/www.viva64.com\/ru\/w\/v1061\/\">V1061<\/a> Extending the &#39;std&#39; namespace may result in undefined behavior. sized_iterator.hh 210<\/p>\n<pre><code class=\"cpp\">\/\/ Dirty hack because g++ 4.6 at least wants \/\/ to do a bunch of copy operations. namespace std { inline void iter_swap(util::SizedIterator first,                       util::SizedIterator second) {   util::swap(*first, *second); } } \/\/ namespace std<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0451\u043c, \u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 &quot;\u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u0442\u0440\u044e\u043a&quot; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0440\u044f\u0437\u043d\u044b\u043c. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d <i>std<\/i> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e. <\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d <i>std<\/i> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u043e\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 C++ \u044f\u0432\u043d\u043e \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c <i>std<\/i> \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c \u0432 g++ 4.6, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f C++03. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443 \u0438\u0437 <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2013\/n3690.pdf\">C++03 final working draft<\/a> (\u0441\u043c. \u043f\u0443\u043d\u043a\u0442 17.6.4.2.1): &quot;\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 C++-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d std \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0432 std, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435&quot;. \u042d\u0442\u0430 \u0446\u0438\u0442\u0430\u0442\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 (C++11, C++14, C++17, \u0438 C++20).<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 &quot;\u0441\u043b\u0443\u0447\u0430\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435&quot;? \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <i>std<\/i> \u043d\u0435 \u0432\u0435\u0434\u0435\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041f\u0440\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/www.viva64.com\/ru\/w\/v1061\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 V1061<\/a>, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u043b\u044f \u043d\u0430\u0441 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0422.\u043a. <i>std<\/i> \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <i>iter_swap<\/i> (\u043e\u0442\u043c\u0435\u0447\u0443: \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0448\u0430\u0431\u043b\u043e\u043d), \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0436\u0435\u043b\u0430\u043b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0441\u043c\u043e\u0433\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0438\u043f\u043e\u043c <i>util::SizedIterator<\/i>. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <i>\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/i>, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b <i>\u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443<\/i>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">namespace std { template &lt;&gt; inline void iter_swap(util::SizedIterator first,                       util::SizedIterator second) {   util::swap(*first, *second); } } \/\/ namespace std<\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C++20. \u0414\u0430-\u0434\u0430, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043d\u0451\u043c \u0442\u043e\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438 \u043a\u0430\u043a \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e (\u0441\u043c. <a href=\"https:\/\/isocpp.org\/files\/papers\/N4860.pdf\">C++20 final working draft<\/a>, \u043f. 16.5.4.2.1). \u0410 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0435\u0451 \u0441\u043e\u0431\u0435\u0440\u0443\u0442 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <i>-std=C++20<\/i>. \u041a\u0441\u0442\u0430\u0442\u0438, PVS-Studio \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442, \u043a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0434\u0430\u0435\u0442 \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0441\u0430\u043c\u0438: <a href=\"https:\/\/godbolt.org\/z\/ez3v6K\">\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f C++17<\/a>, <a href=\"https:\/\/godbolt.org\/z\/4P8EoG\">\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f C++20<\/a>. <\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <i>iter_swap<\/i> \u0432 \u0442\u043e\u0442 \u0436\u0435 namespace, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u043a\u043b\u0430\u0441\u0441 <i>SizedIterator<\/i>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043c\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <i>iter_swap<\/i>, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c &quot;using std::iter_swap;&quot;. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <i>SizedIterator<\/i> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>util::swap()<\/i> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b):<\/p>\n<pre><code class=\"cpp\">namespace util {   class SizedIterator   {   public:     SizedIterator(int i) : m_data(i) {}      int&amp; operator*()     {       return m_data;     }   private:     int m_data;   };    ....    inline void iter_swap(SizedIterator first,                         SizedIterator second)   {     std::cout &lt;&lt; &quot;we are inside util::iter_swap&quot; &lt;&lt; std::endl;     swap(*first, *second);   } }   int main() {   double d1 = 1.1, d2 = 2.2;   double *pd1 = &amp;d1, *pd2 = &amp;d2;   util::SizedIterator si1(42), si2(43);    using std::iter_swap;    iter_swap(pd1, pd2);   iter_swap(si1, si2); \/\/ &quot;we are inside util::iter_swap&quot;    return 0; }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>iter_swap<\/i> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (ADL). \u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <i>SizedIterator<\/i> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0438\u0437 <i>namespace util<\/i>, \u0430 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0438\u0437 <i>namespace std<\/i>. \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 <a href=\"https:\/\/godbolt.org\/z\/dqd97q\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 &quot;using&quot;: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0445 \u043a\u043e\u0434 \u0438 \u0442\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <i>std<\/i>, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<p>  \u0418 \u0442\u043e\u0433\u0434\u0430 \u2013 \u0432\u0443\u0430\u043b\u044f \u2013 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>iter_swap<\/i> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u0434\u043e \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 &quot;\u0433\u0440\u044f\u0437\u043d\u044b\u0445 \u0442\u0440\u044e\u043a\u043e\u0432&quot; \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u043b\u0434\u043e\u0432\u0441\u0442\u0432\u0430 \ud83d\ude42<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/037\/1ab\/b41\/0371abb41d1f34e5aa65df8234d2ac1e.png\" alt=\"image3.png\"><\/div>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0446\u0443. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u044b\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0438 \u0432\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435 \u0436\u0435\u043b\u0430\u044e \u0432\u0430\u043c \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0438 \u043e\u043f\u0440\u044f\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u0443\u0441\u0442\u044c \u0431\u0430\u0433\u0438 \u043e\u0431\u0445\u043e\u0434\u044f\u0442 \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439!<\/p>\n<p>  <b>P.S.<\/b> \u041c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 namespace std \u2013 \u044d\u0442\u043e \u043f\u043b\u043e\u0445\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430. \u0410 \u043a\u0430\u043a \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u0432\u044b? \u0416\u0434\u0443 \u0432\u0430\u0448\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u0430 C, C++, C# \u0438\u043b\u0438 Java \u0438 \u0432\u0430\u043c, \u043a\u0430\u043a \u0438 \u043c\u043d\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0442\u0435\u043c\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/viva64.com\/ru\/pvs-studio-download\/\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>  <a href=\"https:\/\/viva64.com\/ru\/pvs-studio-download\/?utm_source=habr&amp;utm_medium=banner&amp;utm_campaign=DeepSpeech_ru\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/04b\/0d5\/022\/04b0d5022b3a6cfadc4732dce7842da7.png\"><\/div>\n<p><\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/499984\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/898\/3b6\/5a7\/8983b65a74adb29a2113eba12fbec3f1.png\"><\/div>\n<p><\/a><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: George Gribkov. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/524022\/\">Checking the Code of DeepSpeech, or Why You Shouldn&#8217;t Write in namespace std<\/a>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/524026\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/524026\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/524026\/\">DeepSpeech \u2013 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Mozilla. \u0414\u0432\u0438\u0436\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043e\u0442\u0437\u044b\u0432\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043c\u0438\u0448\u0435\u043d\u044c\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 C++-\u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 DeepSpeech. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5ad\/5d0\/076\/5ad5d0076af2293cc7c41dc5db49f05b.png\" alt=\"image1.png\"><\/div>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-311665","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311665"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311665\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}