{"id":471410,"date":"2025-08-20T21:02:17","date_gmt":"2025-08-20T21:02:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471410"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471410","title":{"rendered":"<span>CMake: \u0433\u0435\u0440\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u043e\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043e 12 \u0431\u0430\u0433\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u044f\u0449\u0438\u043a \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u041d\u043e \u0432\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438 \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0441\u0443\u043f\u0435\u0440\u0433\u0435\u0440\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0440\u0443\u0447\u0430\u0435\u0442 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u0418 \u0438\u043c\u044f \u044d\u0442\u043e\u043c\u0443 \u0433\u0435\u0440\u043e\u044e \u2014 CMake! \u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0438 \u043d\u0438\u043a\u043e\u0433\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442, \u0434\u0430\u0436\u0435 \u0441\u0443\u043f\u0435\u0440\u0433\u0435\u0440\u043e\u0435\u0432. \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u0440\u043e\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b6c\/f61\/8ea\/b6cf618ead99406065b8a8d76bcbe9d3.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/b6c\/f61\/8ea\/b6cf618ead99406065b8a8d76bcbe9d3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b6c\/f61\/8ea\/b6cf618ead99406065b8a8d76bcbe9d3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>CMake \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432. \u041e\u043d \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u0434 \u0441\u0430\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c-\u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a GNU make, Ninja, MSBuild \u0438 \u0442.\u0434.<\/p>\n<p>\u041d\u0430\u0448 \u0433\u0435\u0440\u043e\u0439 \u0437\u0430\u0434\u0430\u0451\u0442 \u0440\u0438\u0442\u043c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u043b\u0430\u0436\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044f\u0441\u044c \u043e \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u0443 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u042f \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u043e\u0442 \u043f\u043e \u044d\u0442\u043e\u0439 <a href=\"https:\/\/github.com\/Kitware\/CMake?tab=readme-ov-file#building-cmake-with-cmake\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a>. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u0437\u0430 \u0447\u0442\u043e \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0433\u0435\u0440\u043e\u044e. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 CMake, \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/cmake.org\/documentation\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u044f \u043e\u0442\u043a\u0440\u044b\u043b\u0430 <code>.sln<\/code> \u0444\u0430\u0439\u043b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=EvgeniyRyzhkov.PVS-Studio\" rel=\"noopener noreferrer nofollow\">PVS-Studio<\/a>. \u0422\u0435\u0433, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u2013 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/tree\/v4.1.0?ref_type=tags\" rel=\"noopener noreferrer nofollow\">v4.1.0<\/a>. \u041e\u0442\u043c\u0435\u0447\u0443, \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u0440\u043e\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0658\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0451\u0439<\/a>.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u043f\u043e High \u0438 Medium \u0443\u0440\u043e\u0432\u043d\u044f\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<h3>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1061\/\" rel=\"noopener noreferrer nofollow\">V1061<\/a> Extending the &#8216;std&#8217; namespace may result in undefined behavior. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmList.h#L1322\" rel=\"noopener noreferrer nofollow\">cmList.h 1322<\/a><\/p>\n<pre><code class=\"cpp\">namespace std \/\/ &lt;= {   inline void swap(cmList&amp; lhs, cmList&amp; rhs) noexcept   {     lhs.swap(rhs);    } } <\/code><\/pre>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 C++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/namespace.std#1\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e<\/a>, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d <code>std<\/code>. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>std::swap<\/code> \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u2014 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0435\u0451 \u0432 \u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d, \u0447\u0442\u043e \u0438 \u0441\u0430\u043c \u0442\u0438\u043f:<\/p>\n<pre><code class=\"cpp\">class cmList { public:   void swap(cmList&amp; other) noexcept { \/* implementation *\/ } private:   \/* private data members *\/ };  inline void swap(cmList&amp; lhs, cmList&amp; rhs) noexcept {   lhs.swap(rhs); } <\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u043a\u0430\u043a \u0436\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438:<\/p>\n<pre><code class=\"cpp\">template &lt;typename T&gt;  void foo(T &amp;obj1, T &amp;obj2) {    using std::swap;  \/\/ \u0441\u0434\u0435\u043b\u0430\u0442\u044c std::swap \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438   ....   swap(obj1, obj2); \/\/ \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 swap \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 T    .... } <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>using std::swap;<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>std::swap<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0430 \u043f\u0440\u0438 \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432e <code>swap(obj1, obj2);<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.lookup.argdep\" rel=\"noopener noreferrer nofollow\">argument-dependent lookup<\/a> (ADL). \u0415\u0441\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>T<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0438\u043f\u043e\u043c <code>cmList<\/code>, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0438\u0449\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 <code>swap<\/code> \u0442\u0430\u043a\u0436\u0435 \u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0430\u0439\u0434\u0451\u0442 \u0442\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<pre><code class=\"cpp\">void cmLocalGenerator::GetDeviceLinkFlags(   cmLinkLineDeviceComputer&amp; linkLineComputer,    std::string const&amp; config,   std::string&amp; linkLibs,    std::string&amp; linkFlags,    std::string&amp; frameworkPath,   std::string&amp; linkPath,    cmGeneratorTarget* target) {   cmGeneratorTarget::DeviceLinkSetter setter(*target);    cmComputeLinkInformation* pcli = target-&gt;GetLinkInformation(config);    auto linklang = linkLineComputer.GetLinkerLanguage(target, config);   auto ipoEnabled = target-&gt;IsIPOEnabled(linklang, config);   if (!ipoEnabled) {     ipoEnabled = linkLineComputer.ComputeRequiresDeviceLinkingIPOFlag(*pcli);   }   ....   if (pcli) {     this-&gt;OutputLinkLibraries(pcli,                               &amp;linkLineComputer,                                 linkLibs,                                 frameworkPath,linkPath);   }   .... } <\/code><\/pre>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443? \u041f\u0440\u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u0435 \u043e\u043d\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u043d\u0435 \u0441\u0440\u0430\u0437\u0443. \u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>pcli<\/code> \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>ComputeRequiresDeviceLinkingIPOFlag<\/code> \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 <code>pcli<\/code> \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0306\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e<\/a>. \u041d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0442\u0430\u043a \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430, \u0438 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/4248bb452a5886ec4b632e2d602fcaafd2b13aaf\/Source\/cmLocalGenerator.cxx#L1432-1441\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0432\u0435\u0442 \u2014 \u043d\u0435\u0442<\/a>:<\/p>\n<pre><code class=\"cpp\">cmComputeLinkInformation* pcli = target-&gt;GetLinkInformation(config); const std::string linkLanguage =   linkLineComputer-&gt;GetLinkerLanguage(target, config);  if (pcli) {   \/\/ Compute the required cuda device link libraries when   \/\/ resolving cuda device symbols   this-&gt;OutputLinkLibraries(pcli, linkLineComputer, linkLibs,                             frameworkPath, linkPath); } <\/code><\/pre>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>pcli<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0417\u0430\u0442\u0435\u043c \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/96bc59b1ca01be231347404d178445263687dd22\/Source\/cmLocalGenerator.cxx#L1393-1403\" rel=\"noopener noreferrer nofollow\">96bc59b1<\/a> \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u043e \u043f\u0440\u0438 \u0435\u0451 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0437\u0430\u0431\u044b\u043b \u0443\u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442. \u0418 \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0441 \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b: \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 Merge Request \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0055\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443<\/a> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">auto linklang = linkLineComputer.GetLinkerLanguage(target, config); auto ipoEnabled = target-&gt;IsIPOEnabled(linklang, config); if (!ipoEnabled &amp;&amp; pcli) {   ipoEnabled = linkLineComputer.ComputeRequiresDeviceLinkingIPOFlag(*pcli); } .... <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u043a\u0430\u043a PVS-Studio \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\" rel=\"noopener noreferrer nofollow\">V595<\/a> The &#8216;pcli&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1445, 1454. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmLocalGenerator.cxx#L1445\" rel=\"noopener noreferrer nofollow\">cmLocalGenerator.cxx 1445<\/a><\/p>\n<p>\u0421\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V595 The &#8216;this-&gt;Properties[index]&#8217; pointer was utilized before it was verified against nullptr. Check lines: 904, 906. cmCTestMultiProcessHandler.cxx 904<\/p>\n<\/li>\n<li>\n<p>V595 The &#8216;cp-&gt;Commands&#8217; pointer was utilized before it was verified against nullptr. Check lines: 536, 539. ProcessWin32.c 536<\/p>\n<\/li>\n<li>\n<p>V595 The &#8216;copy_rule&#8217; pointer was utilized before it was verified against nullptr. Check lines: 3004, 3006. cmLocalGenerator.cxx 3004V<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v573\/\" rel=\"noopener noreferrer nofollow\">V573<\/a> Uninitialized variable &#8216;intDir&#8217; was used. The variable was used to initialize itself. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmGlobalVisualStudio7Generator.cxx#L626\" rel=\"noopener noreferrer nofollow\">cmGlobalVisualStudio7Generator.cxx 626<\/a><\/p>\n<pre><code class=\"cpp\">std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend(   cmGeneratorTarget const* target) {   std::vector&lt;std::string&gt; configs =     target-&gt;Target-&gt;GetMakefile()-&gt;GetGeneratorConfigs(       cmMakefile::ExcludeEmptyConfig);   ....   \/* clang-format on *\/   std::string intDirPrefix =     target-&gt;GetLocalGenerator()-&gt;MaybeRelativeToCurBinDir(       cmStrCat(target-&gt;GetSupportDirectory(), '\\\\'));   for (std::string const&amp; i : configs) {     std::string intDir = cmStrCat(intDir, i);               \/\/ &lt;=     ....   }   .... } <\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043f\u0430\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/commit\/b82a74d91805631b7542ce99896722d7fdc50f5a#a77a481daea2cd01292143b8e40b8decae016977\" rel=\"noopener noreferrer nofollow\">b82a74d9<\/a><strong>.<\/strong> \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>configs<\/code> \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (<code>intDir<\/code>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 <code>*.vcproj<\/code> \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>intDir<\/code> \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0439 \u0436\u0435 \u0441\u0435\u0431\u044f. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0442.\u043a. \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u0447\u043d\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (<a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.scope.pdecl#1\" rel=\"noopener noreferrer nofollow\">[1]<\/a>, <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.life#1\" rel=\"noopener noreferrer nofollow\">[2]<\/a>). \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0446\u0438\u043a\u043b\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0438 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043e\u043c <code>Prefix<\/code>, \u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u043d\u0430 \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>intDir<\/code>:<\/p>\n<pre><code class=\"cpp\">std::string intDirPrefix = ....; for (std::string const&amp; i : configs) {   std::string intDir = cmStrCat(intDirPrefix, i);   .... } <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v778\/\" rel=\"noopener noreferrer nofollow\">V778<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;writeOp&#8217; variable should be used instead of &#8216;readOp&#8217;. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmDebuggerWindowsPipeConnection.cxx#L20\" rel=\"noopener noreferrer nofollow\">cmDebuggerWindowsPipeConnection.cxx 20<\/a><\/p>\n<pre><code class=\"cpp\">class DuplexPipe_WIN32 { public:   DuplexPipe_WIN32(HANDLE read);   .... private:   HANDLE hPipe;   OVERLAPPED readOp;   OVERLAPPED writeOp; };  DuplexPipe_WIN32::DuplexPipe_WIN32(HANDLE pipe) : hPipe(pipe) {   readOp.Offset = readOp.OffsetHigh = 0;   readOp.hEvent = CreateEvent(NULL, true, false, NULL);   writeOp.Offset = readOp.OffsetHigh = 0;   writeOp.hEvent = CreateEvent(NULL, true, false, NULL); } <\/code><\/pre>\n<p>\u0412 \u0442\u0435\u043b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 <code>DuplexPipe_WIN32<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0439 <code>readOp<\/code> \u0438 <code>writeOp<\/code> \u0442\u0438\u043f\u0430 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/minwinbase\/ns-minwinbase-overlapped\" rel=\"noopener noreferrer nofollow\"><code>OVERLAPPED<\/code><\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u044f <code>Offset<\/code>, <code>OffsetHigh<\/code>, <code>hEvent<\/code>. \u041d\u0430\u0447\u0430\u043b \u043e\u043d \u0441 \u043f\u043e\u043b\u044f <code>readOp<\/code>, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0430\u043b\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c <code>writeOp<\/code>, \u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0440\u0435\u0448\u0438\u043b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0448\u0435 \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u0431\u044b\u043b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0436\u0435 <code>readOp.OffsetHigh<\/code>, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">class DuplexPipe_WIN32 { public:   DuplexPipe_WIN32(HANDLE read);   .... private:   HANDLE hPipe;   OVERLAPPED  readOp {};   OVERLAPPED writeOp {}; };  DuplexPipe_WIN32::DuplexPipe_WIN32(HANDLE pipe): hPipe(pipe) {   readOp.hEvent = CreateEvent(NULL, true, false, NULL);   writeOp.hEvent = CreateEvent(NULL, true, false, NULL); } <\/code><\/pre>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/sync\/synchronization-and-overlapped-input-and-output\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<p><em>All of the members of the OVERLAPPED structure must be initialized to zero unless an event will be used to signal completion of an I\/O operation. If an event is used, the hEvent member of the OVERLAPPED structure specifies a handle to the allocated event object.<\/em><\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u043b\u0435\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442 \u0432\u0441\u0451 \u043d\u0443\u043b\u044f\u043c\u0438 \u0432 <code>OVERLAPPED<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432 \u0442\u0435\u043b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>readOp.hEvent<\/code> \u0438 <code>writeOp.hEvent<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1028\/\" rel=\"noopener noreferrer nofollow\">V1028<\/a> Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. <a href=\"https:\/\/github.com\/Kitware\/CMake\/blob\/51e22572ed2294273161ee7a33349e9bd591ba8e\/Source\/LexerParser\/cmExprLexer.cxx#L1851\" rel=\"noopener noreferrer nofollow\">cmExprLexer.cxx 1851<\/a><\/p>\n<pre><code class=\"cpp\">typedef void* yyscan_t; typedef size_t yy_size_t;  void *yyalloc ( yy_size_t , yyscan_t yyscanner );  YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes,                                 int  _yybytes_len ,                                 yyscan_t yyscanner) {   YY_BUFFER_STATE b;   char *buf;   yy_size_t n;   int i;    \/\/ Get memory for full buffer, including space for trailing EOB's.   n = (yy_size_t) (_yybytes_len + 2);   buf = (char *) yyalloc( n , yyscanner );   if ( ! buf )   YY_FATAL_ERROR( \"out of dynamic memory in yy_scan_bytes()\" );    for ( i = 0; i &lt; _yybytes_len; ++i )     buf[i] = yybytes[i];    buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;   .... } <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>yybytes_len<\/code> \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <code>int<\/code> \u0438 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 <code>buf<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0432\u0438\u0434\u0435 \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439. \u041f\u0440\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 (\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e), \u0435\u0441\u043b\u0438 <code>yybytes_len<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 <code>[INT_MAX \u2013 1 .. INT_MAX]<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u043e\u0434\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/0002\/\" rel=\"noopener noreferrer nofollow\">64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/a>. \u0418, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0451 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0441 \u0442\u0438\u043f\u043e\u043c <code>size_t<\/code>, \u0430 \u043d\u0435 <code>int<\/code>. \u041f\u0440\u0438\u0447\u0451\u043c \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0436\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0438\u043f\u0430 <code>size_t<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/LexerParser\/cmExprLexer.cxx#L1833\" rel=\"noopener noreferrer nofollow\">\u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438<\/a> \u0432 <code>int<\/code>:<\/p>\n<pre><code class=\"cpp\">YY_BUFFER_STATE yy_scan_string (const char * yystr ,                                 yyscan_t yyscanner) {   return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0438\u043f <code>size_t<\/code>, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044f\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0438\u043d\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0441 <code>int<\/code> \u043d\u0430 <code>size_t<\/code>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>i<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmListFileLexer.c 1586<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmListFileLexer.c 1923<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmListFileLexer.c 2176<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmFortranLexer.cxx 1661<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmFortranLexer.cxx 1990<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmFortranLexer.cxx 2243<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmExprLexer.cxx 1272<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmExprLexer.cxx 1598<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmGccDepfileLexer.cxx 1275<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmGccDepfileLexer.cxx 1601<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmGccDepfileLexer.cxx 1854<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmDependsJavaLexer.cxx 1860<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmDependsJavaLexer.cxx 2186<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmDependsJavaLexer.cxx 2439<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmCTestResourceGroupsLexer.cxx 1269<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;b-&gt;yy_buf_size + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmCTestResourceGroupsLexer.cxx 1595<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. cmCTestResourceGroupsLexer.cxx 1848<\/p>\n<\/li>\n<li>\n<p>V1028 Possible overflow. Consider casting operands of the &#8216;* size * 2&#8217; operator to the &#8216;size_t&#8217; type, not the result. System.c 31<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6<\/strong><\/p>\n<pre><code class=\"cpp\">\/**  * Append two or more strings and produce new one.  * Programmer must 'delete []' the resulting string,  * which was allocated with 'new'.  * Return 0 if inputs are empty or there was an error  *\/ char* SystemTools::AppendStrings(char const* str1,                                  char const* str2) {   if (!str1) {     return SystemTools::DuplicateString(str2);   }   if (!str2) {     return SystemTools::DuplicateString(str1);   }   size_t len1 = strlen(str1);   char* newstr = new char[len1 + strlen(str2) + 1];   if (!newstr) {     return nullptr;   }   strcpy(newstr, str1);   strcat(newstr + len1, str2);   return newstr; } <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>SystemTools::AppendStrings<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043d\u043e\u0432\u043e\u043c \u0431\u0443\u0444\u0435\u0440\u0435 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0430? \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438: &#171;\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c&#187;. \u0422\u0430\u043a \u043b\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435? \u041d\u0435\u0442, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>new<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u0440\u043e\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/new\/bad_alloc.html\" rel=\"noopener noreferrer nofollow\"><code>std::bad_alloc<\/code><\/a>. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430: \u0435\u0441\u043b\u0438 \u0431\u0440\u043e\u0441\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>new<\/code> \u0432\u0435\u0440\u043d\u0451\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/new\/nothrow_t.html\" rel=\"noopener noreferrer nofollow\"><code>nothrow<\/code><\/a>-\u0432\u0435\u0440\u0441\u0438\u044e \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">char* newstr = new (std::nothrow) char[len1 + strlen(str2) + 1]; if (!newstr) {   return nullptr; } <\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v668\/\" rel=\"noopener noreferrer nofollow\">V668<\/a> There is no sense in testing the &#8216;newstr&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/kwsys\/SystemTools.cxx#L1724\" rel=\"noopener noreferrer nofollow\">SystemTools.cxx 1724<\/a><\/p>\n<p>\u0421\u0445\u043e\u0436\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>V668 There is no sense in testing the &#8216;newstr&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. SystemTools.cxx 1747<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v557\/\" rel=\"noopener noreferrer nofollow\">V557<\/a> Array overrun is possible. The value of &#8216;length &#8212; 1&#8217; index could reach 18446744073709551615. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/kwsys\/ProcessWin32.c#L1942\" rel=\"noopener noreferrer nofollow\">ProcessWin32.c 1942<\/a><\/p>\n<pre><code class=\"cpp\">void kwsysProcessCleanErrorMessage(kwsysProcess* cp) {   \/* Remove trailing period and newline, if any. *\/   size_t length = strlen(cp-&gt;ErrorMessage);   if (cp-&gt;ErrorMessage[length - 1] == '\\n') {     cp-&gt;ErrorMessage[length - 1] = 0;     --length;     if (length &gt; 0 &amp;&amp; cp-&gt;ErrorMessage[length - 1] == '\\r') {       cp-&gt;ErrorMessage[length - 1] = 0;       --length;     }   }   if (length &gt; 0 &amp;&amp; cp-&gt;ErrorMessage[length - 1] == '.') {     cp-&gt;ErrorMessage[length - 1] = 0;   } } <\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u0415\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>.\\r\\n<\/code>, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0434\u0430\u043b\u0438\u0442 \u0438\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0430\u0432\u0435\u043d <code>\\n<\/code>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0434\u043b\u0438\u043d\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043e\u043d\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u043f\u0443\u0441\u0442\u043e\u0435, \u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/types\/climits.html\" rel=\"noopener noreferrer nofollow\"><code>SIZE_MAX<\/code><\/a> \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0443\u0444\u0435\u0440\u0430. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1241\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e<\/a>. \u0417\u0430\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 <code>.<\/code> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b.<\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">void kwsysProcessCleanErrorMessage(kwsysProcess* cp) {   \/* Remove trailing period and newline, if any. *\/   size_t length = strlen(cp-&gt;ErrorMessage);   if (length &gt; 0 &amp;&amp; cp-&gt;ErrorMessage[length - 1] == '\\n')   .... } <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1043\/\" rel=\"noopener noreferrer nofollow\">V1043<\/a> A global object variable &#8216;cmPropertySentinel&#8217; is declared in the header. Multiple copies of it will be created in all translation units that include this header file. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmStatePrivate.h#L27\" rel=\"noopener noreferrer nofollow\">cmStatePrivate.h 27<\/a><\/p>\n<pre><code class=\"cpp\">\/\/ cmStatePrivate.h .... static std::string const cmPropertySentinel = std::string(); <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041f\u0440\u0438 \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u0432\u043e\u044f \u043a\u043e\u043f\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6506\/#ID0AB1BD61C2\" rel=\"noopener noreferrer nofollow\">\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f<\/a>. \u0412 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0430\u0436 \u0438\u0437-\u0437\u0430 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u0447\u0438\u043d:<\/p>\n<ul>\n<li>\n<p>\u043e\u043d\u0430 \u043d\u0435 <code>volatile<\/code>, \u043d\u043e <code>const<\/code>-\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043e\u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c <code>static<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0431\u0435\u0433\u043b\u043e\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u0435 \u043d\u0430 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmState.cxx#L24\" rel=\"noopener noreferrer nofollow\"><code>cmState.cxx<\/code><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmStateDirectory.cxx#L22\" rel=\"noopener noreferrer nofollow\"><code>cmStateDirectory.cxx<\/code><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmStateSnapshot.cxx#L22\" rel=\"noopener noreferrer nofollow\"><code>cmStateSnapshot.cxx<\/code><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p>\u0414\u043e C++17:<\/p>\n<pre><code class=\"cpp\">\/\/ cmStatePrivate.h .... extern std::string const cmPropertySentinel;  \/\/ some translation unit  #include \"cmStatePrivate.h\"  std::string const cmPropertySentinel = std::string(); <\/code><\/pre>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C++17:<\/p>\n<pre><code class=\"cpp\">\/\/ cmStatePrivate.h .... inline std::string const cmPropertySentinel = std::string(); <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v571\/\" rel=\"noopener noreferrer nofollow\">V571<\/a> Recurring check. This condition was already verified in line 2528. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmQtAutoGenInitializer.h#L2529\" rel=\"noopener noreferrer nofollow\">cmQtAutoGenInitializer.cxx 2529<\/a><\/p>\n<pre><code class=\"cpp\">bool cmQtAutoGenInitializer::GetQtExecutable(   GenVarsT&amp; genVars,   std::string const&amp; executable,    bool ignoreMissingTarget) const {    ....    std::string err;    genVars.ExecutableFeatures =       this-&gt;GlobalInitializer-&gt;GetCompilerFeatures(                                 executable, genVars.Executable,                                 err, this-&gt;MultiConfig,                                 this-&gt;UseBetterGraph);     if (this-&gt;MultiConfig &amp;&amp; this-&gt;UseBetterGraph)    {     for (auto const&amp; config : this-&gt;ConfigsList)     {       if (!genVars.ExecutableFeatures.Config[config])   \/\/ &lt;=       {         if (!genVars.ExecutableFeatures.Config[config]) \/\/ &lt;=         {           print_err(err);           return false;         }       }     }   }    ....  } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u044f\u0432\u0438\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443: \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>!genVars.ExecutableFeatures.Config[config]<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u043e\u0434\u0440\u044f\u0434. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">class CompilerFeatures { \/* .... *\/ };  using CompilerFeaturesHandle = std::shared_ptr&lt;CompilerFeatures&gt;;  class cmQtAutoGen { public:   ....   \/** String values with per configuration variants.  *\/   template &lt;typename C&gt;   class ConfigStrings   {   public:     C Default;     std::unordered_map&lt;std::string, C&gt; Config;   };   .... };  class cmQtAutoGenInitializer : public cmQtAutoGen { public:   \/** Abstract moc\/uic\/rcc generator variables base class.  *\/   struct GenVarsT   {     ....     ConfigStrings&lt;CompilerFeaturesHandle&gt; ExecutableFeatures;   };   .... private:   ....   bool GetQtExecutable(GenVarsT&amp; genVars,                        std::string const&amp; executable,                        bool ignoreMissingTarget) const;   .... }; <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u043b\u0435 <code>Config<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0442\u0438\u043f\u0430 <code>std::unordered_map&lt;std::string, std::shared_ptr&lt;CompilerFeatures&gt;&gt;<\/code>. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>[]<\/code> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u0442 \u043f\u043e\u0438\u0441\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u0438 \u043b\u0438\u0431\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u043d\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u043b\u0438\u0431\u043e \u043d\u0430 \u043d\u043e\u0432\u044b\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043e \u043a\u0430\u043a <code>true<\/code> \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ol>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u0431\u044b\u043b \u043d\u0443\u043b\u0435\u0432\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u0422\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043c\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e, \u0442.\u043a. \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>GetCompilerFeatures<\/code>: \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0438\u0437 <code>ConfigsList<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>genVars.ExecutableFeatures<\/code> \u0438 \u0431\u044b\u0442\u044c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043e, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>false<\/code>.<\/p>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0438\u0434\u0435\u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (this-&gt;MultiConfig &amp;&amp; this-&gt;UseBetterGraph) {   bool ok = std::all_of(               this-&gt;ConfigsList.begin(),               this-&gt;ConfigsList.end(),               [&amp;Config = genVars.ExecutableFeatures.Config](auto &amp;&amp;config)               {                 auto it = Config.find(config);                 return it != Config.end() &amp;&amp; it-&gt;second;               });    if (!ok)   {     print_err(err);     return false;   } } <\/code><\/pre>\n<p>\u0421\u0445\u043e\u0436\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>V571 Recurring check. The &#8216;!cm-&gt;SourceFile.empty()&#8217; condition was already verified in line 580. cmCTestBuildHandler.cxx 581<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v728\/\" rel=\"noopener noreferrer nofollow\">V728<\/a> An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;arguments.ErrorVariable.empty()&#8217; and &#8216;!arguments.ErrorVariable.empty()&#8217;.  <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmExecuteProcessCommand.cxx#L257\" rel=\"noopener noreferrer nofollow\">cmExecuteProcessCommand.cxx 257<\/a><\/p>\n<pre><code class=\"cpp\">bool cmExecuteProcessCommand(std::vector&lt;std::string&gt; const&amp; args,                              cmExecutionStatus&amp; status) {   ....   else if (  arguments.ErrorVariable.empty() ||              (!arguments.ErrorVariable.empty() &amp;&amp;                arguments.OutputVariable != arguments.ErrorVariable))   {     ....     }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>arguments.ErrorVariable.empty()<\/code> \u0434\u0432\u0430\u0436\u0434\u044b \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043e\u043d\u043e \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>||<\/code> \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0441\u044f \u043a\u0430\u043a <code>false<\/code>, \u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u043e\u043d\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 <code>true<\/code>.<\/p>\n<p>\u0423\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">else if (   arguments.ErrorVariable.empty()           || arguments.OutputVariable != arguments.ErrorVariable) {   .... } <\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c, \u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u0434\u0432\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438. \u0412\u0432\u0435\u0434\u0451\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p><code>arguments.ErrorVariable.empty()<\/code> \u043a\u0430\u043a \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>A<\/code>;<\/p>\n<p><code>arguments.OutputVariable != arguments.ErrorVariable<\/code> \u043a\u0430\u043a \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>B<\/code>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/3fd\/04d\/fb8\/3fd04dfb8e96263468dd68c77e2b2ac5.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/3fd\/04d\/fb8\/3fd04dfb8e96263468dd68c77e2b2ac5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/3fd\/04d\/fb8\/3fd04dfb8e96263468dd68c77e2b2ac5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0432\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u043f\u0440\u0438 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0442\u0443 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0443, \u0447\u0442\u043e \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435. \u0422\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0449\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f.<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;(A &amp;&amp; B) || (!A &amp;&amp; !B)&#8217; expression is equivalent to the &#8216;bool(A) == bool(B)&#8217; expression. cmGlobalGhsMultiGenerator.cxx 341<\/p>\n<\/li>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;(A &amp;&amp; !B) || (!A &amp;&amp; B)&#8217; expression is equivalent to the &#8216;bool(A) != bool(B)&#8217; expression. testDynamicLoader.cxx 81<\/p>\n<\/li>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;(A &amp;&amp; !B) || (!A &amp;&amp; B)&#8217; expression is equivalent to the &#8216;bool(A) != bool(B)&#8217; expression. testDynamicLoader.cxx 88<\/p>\n<\/li>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;(A &amp;&amp; !B) || (!A &amp;&amp; B)&#8217; expression is equivalent to the &#8216;bool(A) != bool(B)&#8217; expression. testDynamicLoader.cxx 95<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\" rel=\"noopener noreferrer nofollow\">V501<\/a> There are identical sub-expressions &#8216;!this-&gt;MakefileVariableSize&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmLocalUnixMakefileGenerator3.cxx#L1292\" rel=\"noopener noreferrer nofollow\">cmLocalUnixMakefileGenerator3.cxx 1292<\/a><\/p>\n<pre><code class=\"cpp\">class cmLocalUnixMakefileGenerator3 : public cmLocalCommonGenerator { .... private:   int MakefileVariableSize; .... };  std::string cmLocalUnixMakefileGenerator3::CreateMakeVariable(   std::string const&amp; s,    std::string const&amp; s2) {   std::string unmodified = cmStrCat(s, s2);   if ((!this-&gt;MakefileVariableSize &amp;&amp; \/\/ &lt;=         unmodified.find('.') == std::string::npos) &amp;&amp;       (!this-&gt;MakefileVariableSize &amp;&amp;         unmodified.find('+') == std::string::npos) &amp;&amp;       (!this-&gt;MakefileVariableSize &amp;&amp;         unmodified.find('-') == std::string::npos)){       return unmodified;   } } <\/code><\/pre>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>cmLocalUnixMakefileGenerator3::CreateMakeVariale<\/code> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <code>!this-&gt;MakefileVariableSize<\/code> \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0438\u0436\u0434\u044b \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>.<\/code>, <code>+<\/code>, <code>-<\/code> \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 <code>unmodified<\/code>. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043e\u0431\u044a\u0451\u043c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>!this-&gt;MakefileVariableSize<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0438, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u043e\u0434\u043d\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\"> if (!this-&gt;MakefileVariableSize &amp;&amp;       unmodified.find('.') == std::string::npos &amp;&amp;       unmodified.find('+') == std::string::npos &amp;&amp;       unmodified.find('-') == std::string::npos) {        return unmodified; } <\/code><\/pre>\n<p>\u041c\u044b \u0443\u0431\u0440\u0430\u043b\u0438 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0442\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0435\u0449\u0451 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e. \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0447\u043b\u0435\u043d\u0430 <code>find<\/code> \u043d\u0430 <code>find_first_of<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0435 \u0432\u0441\u0435 \u0442\u0440\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">if (!this-&gt;MakefileVariableSize &amp;&amp;      unmodified.find_first_of(\".+-\") == std::string::npos) {    return unmodified; } <\/code><\/pre>\n<p>\u0421\u0445\u043e\u0436\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>V501 There are identical sub-expressions &#8216;!options.empty()&#8217; to the left and to the right of the &#8216;||&#8217; operator. cmVisualStudio10TargetGenerator.cxx 2912<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N12<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v523\/\" rel=\"noopener noreferrer nofollow\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmComputeLinkInformation.cxx#L1748\" rel=\"noopener noreferrer nofollow\">cmComputeLinkInformation.cxx 1748<\/a><\/p>\n<pre><code class=\"cpp\">bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const&amp; entry) {   BT&lt;std::string&gt; const&amp; item = entry.Item;    \/\/ We only switch to a pathless item if the link type may be   \/\/ enforced.  Fortunately only platforms that support link types   \/\/ seem to have magic per-architecture implicit link directories.   if (!this-&gt;LinkTypeEnabled) {     return false;   }    \/\/ Check if this item is in an implicit link directory.   std::string dir = cmSystemTools::GetFilenamePath(item.Value);   if (!cm::contains(this-&gt;ImplicitLinkDirs, dir)) {     \/\/ Only libraries in implicit link directories are converted to     \/\/ pathless items.     return false;   }    \/\/ Only apply the policy below if the library file is one that can   \/\/ be found by the linker.   std::string file = cmSystemTools::GetFilenameName(item.Value);   if (!this-&gt;ExtractAnyLibraryName.find(file)) {     return false;   }    return false; } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>CheckImplicitDirItem<\/code> \u0447\u0442\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u043d\u0435 \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p><code>then<\/code>-\u0432\u0435\u0442\u043a\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>if<\/code> \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043d\u0438\u0436\u0435\u043b\u0435\u0436\u0430\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c (<code>return false;<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0435 \u0432\u0435\u0442\u0432\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>false<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0451 \u0432\u044b\u0437\u043e\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmComputeLinkInformation.cxx#L1685\" rel=\"noopener noreferrer nofollow\"><code>AddFullItem<\/code><\/a> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u0430\u043d\u043d\u0435\u043c\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <code>return false;<\/code>, \u0442.\u043a. \u044d\u0442\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 &#171;<a href=\"https:\/\/szymonkrajewski.pl\/why-should-you-return-early\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u043d\u043d\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0442<\/a>&#171;. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430. \u041f\u0440\u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 &#171;\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439&#187; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441 \u0446\u0435\u043b\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0435\u0451 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 &#171;\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439&#187; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u0438\u043f\u0430 <code>LinkEntry<\/code> \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>true<\/code>.<\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">.... std::string file = cmSystemTools::GetFilenameName(item.Value); if (!this-&gt;ExtractAnyLibraryName.find(file)) {   return false; }  return true; <\/code><\/pre>\n<p>\u0421\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V523 The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. cmGlobVerificationManager.cxx 128<\/p>\n<\/li>\n<li>\n<p>V523 The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. cmListCommand.cxx 92<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u0448 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e CMake \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0446\u0443. \u042d\u0442\u043e\u0442 \u0433\u0435\u0440\u043e\u0439, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 (\u043e\u0442 copy-paste \u0434\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a), \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041c\u044b \u0432\u0441\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u043c\u0430\u0445\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u0441 \u043f\u043b\u043e\u0445\u0438\u043c\u0438. \u0422\u0430\u043a \u0438 CMake \u2014 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0435\u0433\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f. \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0440\u0430\u043d\u0435\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432 \u0443\u0436\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b, \u0438 \u044d\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e CMake \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u043c \u0432 \u043c\u0438\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 C, C++, C#, Java, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u043d\u0430\u0448\u0438\u043c <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/download\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1277\" rel=\"noopener noreferrer nofollow\">\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/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: Elizaveta Zhegalova. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1277\/\" rel=\"noopener noreferrer nofollow\">CMake: hero who tripped over 12 bugs<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/939066\/\"> https:\/\/habr.com\/ru\/articles\/939066\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u044f\u0449\u0438\u043a \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u041d\u043e \u0432\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438 \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0441\u0443\u043f\u0435\u0440\u0433\u0435\u0440\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0440\u0443\u0447\u0430\u0435\u0442 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u0418 \u0438\u043c\u044f \u044d\u0442\u043e\u043c\u0443 \u0433\u0435\u0440\u043e\u044e \u2014 CMake! \u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0438 \u043d\u0438\u043a\u043e\u0433\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442, \u0434\u0430\u0436\u0435 \u0441\u0443\u043f\u0435\u0440\u0433\u0435\u0440\u043e\u0435\u0432. \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u0440\u043e\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>CMake \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432. \u041e\u043d \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u0434 \u0441\u0430\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c-\u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a GNU make, Ninja, MSBuild \u0438 \u0442.\u0434.<\/p>\n<p>\u041d\u0430\u0448 \u0433\u0435\u0440\u043e\u0439 \u0437\u0430\u0434\u0430\u0451\u0442 \u0440\u0438\u0442\u043c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u043b\u0430\u0436\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044f\u0441\u044c \u043e \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u0443 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u042f \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u043e\u0442 \u043f\u043e \u044d\u0442\u043e\u0439 <a href=\"https:\/\/github.com\/Kitware\/CMake?tab=readme-ov-file#building-cmake-with-cmake\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a>. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u0437\u0430 \u0447\u0442\u043e \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0433\u0435\u0440\u043e\u044e. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 CMake, \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/cmake.org\/documentation\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u044f \u043e\u0442\u043a\u0440\u044b\u043b\u0430 <code>.sln<\/code> \u0444\u0430\u0439\u043b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=EvgeniyRyzhkov.PVS-Studio\" rel=\"noopener noreferrer nofollow\">PVS-Studio<\/a>. \u0422\u0435\u0433, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u2013 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/tree\/v4.1.0?ref_type=tags\" rel=\"noopener noreferrer nofollow\">v4.1.0<\/a>. \u041e\u0442\u043c\u0435\u0447\u0443, \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u0440\u043e\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0658\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0451\u0439<\/a>.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u043f\u043e High \u0438 Medium \u0443\u0440\u043e\u0432\u043d\u044f\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<h3>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1061\/\" rel=\"noopener noreferrer nofollow\">V1061<\/a> Extending the &#8216;std&#8217; namespace may result in undefined behavior. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmList.h#L1322\" rel=\"noopener noreferrer nofollow\">cmList.h 1322<\/a><\/p>\n<pre><code class=\"cpp\">namespace std \/\/ &lt;= {   inline void swap(cmList&amp; lhs, cmList&amp; rhs) noexcept   {     lhs.swap(rhs);    } } <\/code><\/pre>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 C++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/namespace.std#1\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e<\/a>, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d <code>std<\/code>. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>std::swap<\/code> \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u2014 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0435\u0451 \u0432 \u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d, \u0447\u0442\u043e \u0438 \u0441\u0430\u043c \u0442\u0438\u043f:<\/p>\n<pre><code class=\"cpp\">class cmList { public:   void swap(cmList&amp; other) noexcept { \/* implementation *\/ } private:   \/* private data members *\/ };  inline void swap(cmList&amp; lhs, cmList&amp; rhs) noexcept {   lhs.swap(rhs); } <\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u043a\u0430\u043a \u0436\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438:<\/p>\n<pre><code class=\"cpp\">template &lt;typename T&gt;  void foo(T &amp;obj1, T &amp;obj2) {    using std::swap;  \/\/ \u0441\u0434\u0435\u043b\u0430\u0442\u044c std::swap \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438   ....   swap(obj1, obj2); \/\/ \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 swap \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 T    .... } <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>using std::swap;<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>std::swap<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0430 \u043f\u0440\u0438 \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432e <code>swap(obj1, obj2);<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.lookup.argdep\" rel=\"noopener noreferrer nofollow\">argument-dependent lookup<\/a> (ADL). \u0415\u0441\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>T<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0438\u043f\u043e\u043c <code>cmList<\/code>, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0438\u0449\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 <code>swap<\/code> \u0442\u0430\u043a\u0436\u0435 \u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0430\u0439\u0434\u0451\u0442 \u0442\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<pre><code class=\"cpp\">void cmLocalGenerator::GetDeviceLinkFlags(   cmLinkLineDeviceComputer&amp; linkLineComputer,    std::string const&amp; config,   std::string&amp; linkLibs,    std::string&amp; linkFlags,    std::string&amp; frameworkPath,   std::string&amp; linkPath,    cmGeneratorTarget* target) {   cmGeneratorTarget::DeviceLinkSetter setter(*target);    cmComputeLinkInformation* pcli = target-&gt;GetLinkInformation(config);    auto linklang = linkLineComputer.GetLinkerLanguage(target, config);   auto ipoEnabled = target-&gt;IsIPOEnabled(linklang, config);   if (!ipoEnabled) {     ipoEnabled = linkLineComputer.ComputeRequiresDeviceLinkingIPOFlag(*pcli);   }   ....   if (pcli) {     this-&gt;OutputLinkLibraries(pcli,                               &amp;linkLineComputer,                                 linkLibs,                                 frameworkPath,linkPath);   }   .... } <\/code><\/pre>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443? \u041f\u0440\u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u0435 \u043e\u043d\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u043d\u0435 \u0441\u0440\u0430\u0437\u0443. \u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>pcli<\/code> \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>ComputeRequiresDeviceLinkingIPOFlag<\/code> \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 <code>pcli<\/code> \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0306\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e<\/a>. \u041d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0442\u0430\u043a \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430, \u0438 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/4248bb452a5886ec4b632e2d602fcaafd2b13aaf\/Source\/cmLocalGenerator.cxx#L1432-1441\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0432\u0435\u0442 \u2014 \u043d\u0435\u0442<\/a>:<\/p>\n<pre><code class=\"cpp\">cmComputeLinkInformation* pcli = target-&gt;GetLinkInformation(config); const std::string linkLanguage =   linkLineComputer-&gt;GetLinkerLanguage(target, config);  if (pcli) {   \/\/ Compute the required cuda device link libraries when   \/\/ resolving cuda device symbols   this-&gt;OutputLinkLibraries(pcli, linkLineComputer, linkLibs,                             frameworkPath, linkPath); } <\/code><\/pre>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>pcli<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0417\u0430\u0442\u0435\u043c \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/96bc59b1ca01be231347404d178445263687dd22\/Source\/cmLocalGenerator.cxx#L1393-1403\" rel=\"noopener noreferrer nofollow\">96bc59b1<\/a> \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u043e \u043f\u0440\u0438 \u0435\u0451 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0437\u0430\u0431\u044b\u043b \u0443\u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442. \u0418 \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0441 \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b: \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 Merge Request \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0055\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443<\/a> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">auto linklang = linkLineComputer.GetLinkerLanguage(target, config); auto ipoEnabled = target-&gt;IsIPOEnabled(linklang, config); if (!ipoEnabled &amp;&amp; pcli) {   ipoEnabled = linkLineComputer.ComputeRequiresDeviceLinkingIPOFlag(*pcli); } .... <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u043a\u0430\u043a PVS-Studio \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\" rel=\"noopener noreferrer nofollow\">V595<\/a> The &#8216;pcli&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1445, 1454. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmLocalGenerator.cxx#L1445\" rel=\"noopener noreferrer nofollow\">cmLocalGenerator.cxx 1445<\/a><\/p>\n<p>\u0421\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V595 The &#8216;this-&gt;Properties[index]&#8217; pointer was utilized before it was verified against nullptr. Check lines: 904, 906. cmCTestMultiProcessHandler.cxx 904<\/p>\n<\/li>\n<li>\n<p>V595 The &#8216;cp-&gt;Commands&#8217; pointer was utilized before it was verified against nullptr. Check lines: 536, 539. ProcessWin32.c 536<\/p>\n<\/li>\n<li>\n<p>V595 The &#8216;copy_rule&#8217; pointer was utilized before it was verified against nullptr. Check lines: 3004, 3006. cmLocalGenerator.cxx 3004V<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v573\/\" rel=\"noopener noreferrer nofollow\">V573<\/a> Uninitialized variable &#8216;intDir&#8217; was used. The variable was used to initialize itself. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmGlobalVisualStudio7Generator.cxx#L626\" rel=\"noopener noreferrer nofollow\">cmGlobalVisualStudio7Generator.cxx 626<\/a><\/p>\n<pre><code class=\"cpp\">std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend(   cmGeneratorTarget const* target) {   std::vector&lt;std::string&gt; configs =     target-&gt;Target-&gt;GetMakefile()-&gt;GetGeneratorConfigs(       cmMakefile::ExcludeEmptyConfig);   ....   \/* clang-format on *\/   std::string intDirPrefix =     target-&gt;GetLocalGenerator()-&gt;MaybeRelativeToCurBinDir(       cmStrCat(target-&gt;GetSupportDirectory(), '\\\\'));   for (std::string const&amp; i : configs) {     std::string intDir = cmStrCat(intDir, i);               \/\/ &lt;=     ....   }   .... } <\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043f\u0430\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/commit\/b82a74d91805631b7542ce99896722d7fdc50f5a#a77a481daea2cd01292143b8e40b8decae016977\" rel=\"noopener noreferrer nofollow\">b82a74d9<\/a><strong>.<\/strong> \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>configs<\/code> \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (<code>intDir<\/code>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 <code>*.vcproj<\/code> \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>intDir<\/code> \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0439 \u0436\u0435 \u0441\u0435\u0431\u044f. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0442.\u043a. \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u0447\u043d\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (<a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.scope.pdecl#1\" rel=\"noopener noreferrer nofollow\">[1]<\/a>, <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/basic.life#1\" rel=\"noopener noreferrer nofollow\">[2]<\/a>). \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0446\u0438\u043a\u043b\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0438 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043e\u043c <code>Prefix<\/code>, \u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u043d\u0430 \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>intDir<\/code>:<\/p>\n<pre><code class=\"cpp\">std::string intDirPrefix = ....; for (std::string const&amp; i : configs) {   std::string intDir = cmStrCat(intDirPrefix, i);   .... } <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v778\/\" rel=\"noopener noreferrer nofollow\">V778<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;writeOp&#8217; variable should be used instead of &#8216;readOp&#8217;. <a href=\"https:\/\/gitlab.kitware.com\/cmake\/cmake\/-\/blob\/v4.1.0\/Source\/cmDebuggerWindowsPipeConnection.cxx#L20\" rel=\"noopener noreferrer nofollow\">cmDebuggerWindowsPipeConnection.cxx 20<\/a><\/p>\n<pre><code class=\"cpp\">class DuplexPipe_WIN32 { public:   DuplexPipe_WIN32(HANDLE read);   .... private:   HANDLE hPipe;   OVERLAPPED readOp;   OVERLAPPED writeOp; };  DuplexPipe_WIN32::DuplexPipe_WIN32(HANDLE pipe) : hPipe(pipe) {   readOp.Offset = readOp.OffsetHigh = 0;   readOp.hEvent = CreateEvent(NULL, true, false, NULL);   writeOp.Offset = readOp.OffsetHigh = 0;   writeOp.hEvent = CreateEvent(NULL, true, false, NULL); } <\/code><\/pre>\n<p>\u0412 \u0442\u0435\u043b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 <code>DuplexPipe_WIN32<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0439 <code>readOp<\/code> \u0438 <code>writeOp<\/code> \u0442\u0438\u043f\u0430 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/minwinbase\/ns-minwinbase-overlapped\" rel=\"noopener noreferrer nofollow\"><code>OVERLAPPED<\/code><\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u044f <code>Offset<\/code>, <code>OffsetHigh<\/code>, <code>hEvent<\/code>. \u041d\u0430\u0447\u0430\u043b \u043e\u043d \u0441 \u043f\u043e\u043b\u044f <code>readOp<\/code>, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0430\u043b\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c <code>writeOp<\/code>, \u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0440\u0435\u0448\u0438\u043b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0448\u0435 \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u0431\u044b\u043b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0436\u0435 <code>readOp.OffsetHigh<\/code>, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">class DuplexPipe_WIN32 { public:   DuplexPipe_WIN32(HANDLE read);   .... private:   HANDLE hPipe;   OVERLAPPED  readOp {};   OVERLAPPED writeOp {}; };  DuplexPipe_WIN32::DuplexPipe_WIN32(HANDLE pipe): hPipe(pipe) {   readOp.hEvent = CreateEvent(NULL, true, false, NULL);   writeOp.hEvent = CreateEvent(NULL, true, false, NULL); } <\/code><\/pre>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/sync\/synchronization-and-overlapped-input-and-output\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<p><em>All of the members of the OVERLAPPED structure must be initialized to zero unless an event will be used to signal completion of an I\/O operation. If an event is used, the hEvent member of the OVERLAPPED structure specifies a handle to the allocated event object.<\/em><\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u043b\u0435\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442 \u0432\u0441\u0451 \u043d\u0443\u043b\u044f\u043c\u0438 \u0432 <code>OVERLAPPED<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432 \u0442\u0435\u043b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>readOp.hEvent<\/code> \u0438 <code>writeOp.hEvent<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1028\/\" rel=\"noopener noreferrer nofollow\">V1028<\/a> Possible overflow. Consider casting operands of the &#8216;_yybytes_len + 2&#8217; operator to the &#8216;yy_size_t&#8217; type, not the result. <a href=\"https:\/\/github.com\/Kitware\/CMake\/blob\/51e22572ed2294273161ee7a33349e9bd591ba8e\/Source\/LexerParser\/cmExprLexer.cxx#L1851\" rel=\"noopener noreferrer nofollow\">cmExprLexer.cxx 1851<\/a><\/p>\n<pre><code class=\"cpp\">typedef void* yyscan_t; typedef size_t yy_size_t;  void *yyalloc ( yy_size_t , yyscan_t yyscanner );  YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes,                                 int  _yybytes_len ,                                 yyscan_t yyscanner) {   <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-471410","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471410","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=471410"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471410\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}