{"id":312113,"date":"2020-10-27T15:00:59","date_gmt":"2020-10-27T15:00:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312113"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312113","title":{"rendered":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Clang 11 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b5\/636\/72e\/6b563672ef87abf5ca9d22c93877c079.png\" alt=\"PVS-Studio: \u0412\u0441\u0451 \u0435\u0449\u0451 \u0434\u043e\u0441\u0442\u043e\u0438\u043d!\"><\/div>\n<p>  \u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u042d\u0442\u043e \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043b\u044e\u0434\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f, \u0434\u043e\u0441\u0442\u043e\u0438\u043d \u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0437\u0432\u0430\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043b\u043e\u0432\u0446\u0430 \u0431\u0430\u0433\u043e\u0432 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c? \u0414\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043d\u0435 \u0441\u0442\u043e\u044f\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 PVS-Studio, \u0432\u043d\u043e\u0432\u044c \u0438 \u0432\u043d\u043e\u0432\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0430\u0436\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 Clang<\/h2>\n<p>  \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u044f \u0432\u0437\u044f\u043b \u0441\u0442\u0430\u0442\u044c\u044e &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0727\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 GCC 10 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio<\/a>&quot;. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0431\u0437\u0430\u0446\u044b, \u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f :).<\/p>\n<p>  \u041d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u0434\u0430 \u0438 \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0430\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0437\u0440\u044f \u0435\u0434\u0438\u043c \u0445\u043b\u0435\u0431 :).<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u043d\u0435\u043b\u044c\u0437\u044f. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u2013 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043a\u043e\u0434\u0435, \u043d\u043e \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043a\u0430\u043a SonarQube, PlatformIO, Azure DevOps, Travis CI, CircleCI, GitLab CI\/CD, Jenkins, Visual Studio. \u042d\u0442\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PVS-Studio \u0434\u0430\u0436\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0441\u0442\u0430\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u042d\u0442\u043e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439. \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u044e\u0442: &quot;\u041c\u043e\u0436\u0435\u0442 \u043b\u0438 PVS-Studio \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b?&quot;. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u043d\u043e\u0432\u044c \u0438 \u0432\u043d\u043e\u0432\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u0438\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0442\u0435\u043c\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Clang. \u041d\u0435\u0442 \u043d\u0443\u0436\u0434\u044b \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043a\u043e\u0434 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u043e\u0433\u043e Clang 11, \u043d\u043e \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 LLVM 11, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u044b, \u043d\u0430\u0439\u0434\u0435\u043d \u0434\u0435\u0444\u0435\u043a\u0442 \u0432 \u043a\u043e\u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. <\/p>\n<p>  \u041a\u043e\u0434 Clang\/LLVM \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u043d\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u043a\u043e\u0434\u0430 GCC. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043d\u0435\u0442 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0443\u0436\u0430\u0441\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430 C++.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0438 \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043c\u0435\u0448\u0430\u044e\u0442 &quot;\u043f\u043e\u043b\u0443\u043b\u043e\u0436\u043d\u044b\u0435&quot; \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0434 &quot;\u043f\u043e\u043b\u0443\u043b\u043e\u0436\u043d\u044b\u043c\u0438&quot; \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0430\u0432, \u043d\u043e \u0442\u043e\u043b\u043a\u0443 \u043e\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">Spaces.SpacesInParentheses = false;               \/\/ &lt;= Spaces.SpacesInCStyleCastParentheses = true;      \/\/ &lt;= verifyFormat(&quot;Type *A = ( Type * )P;&quot;, Spaces); verifyFormat(&quot;Type *A = ( vector&lt;Type *, int *&gt; )P;&quot;, Spaces); verifyFormat(&quot;x = ( int32 )y;&quot;, Spaces); verifyFormat(&quot;int a = ( int )(2.0f);&quot;, Spaces); verifyFormat(&quot;#define AA(X) sizeof((( X * )NULL)-&gt;a)&quot;, Spaces); verifyFormat(&quot;my_int a = ( my_int )sizeof(int);&quot;, Spaces); verifyFormat(&quot;#define x (( int )-1)&quot;, Spaces);  \/\/ Run the first set of tests again with: Spaces.SpacesInParentheses = false;               \/\/ &lt;= Spaces.SpaceInEmptyParentheses = true; Spaces.SpacesInCStyleCastParentheses = true;      \/\/ &lt;= verifyFormat(&quot;call(x, y, z);&quot;, Spaces); verifyFormat(&quot;call( );&quot;, Spaces);<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0442\u0430\u043a \u0432 \u043d\u0438\u0445 \u043b\u0435\u0436\u0430\u0442:<\/p>\n<ul>\n<li>V1048 The &#39;Spaces.SpacesInParentheses&#39; variable was assigned the same value. FormatTest.cpp 11554<\/li>\n<li>V1048 The &#39;Spaces.SpacesInCStyleCastParentheses&#39; variable was assigned the same value. FormatTest.cpp 11556<\/li>\n<\/ul>\n<p>  \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0432\u0435\u0440\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u0438 \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0430 \u0430\u0432\u0442\u043e\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Options.inc. \u0412 \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c &quot;\u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e \u043a\u043e\u0434\u0430&quot;:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b89\/09b\/d7a\/b8909bd7a9a6aa8a7f3c8fddfe0af1bf.png\" alt=\"\u041a\u043e\u0434\"><\/div>\n<p>  \u0418 \u043d\u0430 \u0432\u0441\u0451 \u044d\u0442\u043e PVS-Studio \u0441\u044b\u043f\u043b\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>V501 There are identical sub-expressions to the left and to the right of the &#39;==&#39; operator: nullptr == nullptr Options.inc 26<\/li>\n<li>V501 There are identical sub-expressions to the left and to the right of the &#39;==&#39; operator: nullptr == nullptr Options.inc 27<\/li>\n<li>V501 There are identical sub-expressions to the left and to the right of the &#39;==&#39; operator: nullptr == nullptr Options.inc 28<\/li>\n<li>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443&#8230;<\/li>\n<\/ul>\n<p>  \u0412\u0441\u0451 \u044d\u0442\u043e \u043d\u0435\u0441\u0442\u0440\u0430\u0448\u043d\u043e. \u0412\u0441\u0451 \u044d\u0442\u043e <a href=\"https:\/\/www.viva64.com\/ru\/b\/0523\/\">\u043c\u043e\u0436\u043d\u043e<\/a> \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c: \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043b\u0438\u0448\u043d\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041c\u043e\u0436\u043d\u043e, \u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 GCC. \u042f \u0438\u0437\u0443\u0447\u0430\u043b \u043e\u0442\u0447\u0451\u0442, \u043f\u043e\u043a\u0430 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043d\u0430\u0431\u0440\u0430\u043b\u043e\u0441\u044c 11 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 11? \u042f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0440\u0430\u0437 \u0432\u0435\u0440\u0441\u0438\u044f Clang \u0440\u0430\u0432\u043d\u0430 11, \u0442\u043e \u043f\u0443\u0441\u0442\u044c \u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 11 :).<\/p>\n<h2>11 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430<\/h2>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1, \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443<\/b><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0fc\/0ae\/0e4\/0fc0ae0e4b09e262098410c6e56e9c5a.png\" alt=\"% 1 - \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430 1\"><\/div>\n<p>  \u041a\u043b\u0430\u0441\u0441\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430! \u041b\u044e\u0431\u043b\u044e \u0442\u0430\u043a\u0438\u0435!<\/p>\n<pre><code class=\"cpp\">void Act() override {   ....   \/\/ If the value type is a vector, and we allow vector select, then in 50%   \/\/ of the cases generate a vector select.   if (isa&lt;FixedVectorType&gt;(Val0-&gt;getType()) &amp;&amp; (getRandom() % 1)) {     unsigned NumElem =         cast&lt;FixedVectorType&gt;(Val0-&gt;getType())-&gt;getNumElements();     CondTy = FixedVectorType::get(CondTy, NumElem);   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V1063 The modulo by 1 operation is meaningless. The result will always be zero. llvm-stress.cpp 631<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0 \u0438\u043b\u0438 1, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e. \u041d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>1<\/i> \u0441\u0431\u0438\u0432\u0430\u0435\u0442 \u0441 \u0442\u043e\u043b\u043a\u0443, \u0438 \u043b\u044e\u0434\u0438 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u0435\u043b\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443, \u0445\u043e\u0442\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u043b\u0438\u0442 \u043d\u0430 \u0434\u0432\u043e\u0439\u043a\u0443. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <i>X % 1<\/i> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0451\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 <i>0<\/i>. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">if (isa&lt;FixedVectorType&gt;(Val0-&gt;getType()) &amp;&amp; (getRandom() % 2)) {<\/code><\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 V1063, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0432 PVS-Studio, \u0434\u043e \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u043d\u043e, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c, \u0438 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0430\u0448\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442. \u041d\u0430\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <a href=\"https:\/\/www.viva64.com\/ru\/b\/0659\/\">PVS-Studio \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430<\/a>. \u0417\u0430\u0441\u0435\u043a\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f, \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 Clang \u0438 GCC :).<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438<\/b><\/p>\n<pre><code class=\"cpp\">class ReturnValueSlot {   ....   bool isNull() const { return !Addr.isValid(); }   .... };  static bool haveSameParameterTypes(ASTContext &amp;Context, const FunctionDecl *F1,                                    const FunctionDecl *F2, unsigned NumParams) {   ....   unsigned I1 = 0, I2 = 0;   for (unsigned I = 0; I != NumParams; ++I) {     QualType T1 = NextParam(F1, I1, I == 0);     QualType T2 = NextParam(F2, I2, I == 0);     if (!T1.isNull() &amp;&amp; !T1.isNull() &amp;&amp; !Context.hasSameUnqualifiedType(T1, T2))       return false;   }   return true; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V501 There are identical sub-expressions to the left and to the right of the &#39;&amp;&amp;&#39; operator: !T1.isNull() &amp;&amp; !T1.isNull() SemaOverload.cpp 9493<\/p>\n<p>  \u0414\u0432\u0430\u0436\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <i>!T1.isNull()<\/i>. \u042d\u0442\u043e \u044f\u0432\u043d\u0430\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u0438 \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>T2<\/i>.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/b><\/p>\n<pre><code class=\"cpp\">std::vector&lt;Decl *&gt; DeclsLoaded;  SourceLocation ASTReader::getSourceLocationForDeclID(GlobalDeclID ID) {   ....   unsigned Index = ID - NUM_PREDEF_DECL_IDS;    if (Index &gt; DeclsLoaded.size()) {     Error(&quot;declaration ID out-of-range for AST file&quot;);     return SourceLocation();   }    if (Decl *D = DeclsLoaded[Index])     return D-&gt;getLocation();   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V557 Array overrun is possible. The &#39;Index&#39; index is pointing beyond array bound. ASTReader.cpp 7318<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>Index<\/i> \u0442\u043e\u0436\u0435 \u0440\u0430\u0432\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 <i>(1 &gt; 1)<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0436\u043d\u044b\u043c, \u0438 \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">if (Index &gt;= DeclsLoaded.size()) {<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/b><\/p>\n<pre><code class=\"cpp\">void IHexELFBuilder::addDataSections() {   ....   uint32_t SecNo = 1;   ....   Section = &amp;Obj-&gt;addSection&lt;OwnedDataSection&gt;(       &quot;.sec&quot; + std::to_string(SecNo++), RecAddr,       ELF::SHF_ALLOC | ELF::SHF_WRITE, SecNo);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V567 Unspecified behavior. The order of argument evaluation is not defined for &#39;addSection&#39; function. Consider inspecting the &#39;SecNo&#39; variable. Object.cpp 1223<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <i>SecNo<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b, \u0434\u0430 \u0435\u0449\u0451 \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u043e\u044f\u0441\u043d\u044e \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">#include &lt;cstdio&gt; int main() {   int i = 1;   printf(&quot;%d, %d\\n&quot;, i, i++);   return 0; }<\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u043d\u043e, \u043a\u0430\u043a &quot;1, 2&quot;, \u0442\u0430\u043a \u0438 &quot;2, 1&quot;. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c Compiler Explorer \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<ul>\n<li>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang 11.0.0, <a href=\"https:\/\/godbolt.org\/z\/YYs4Te\">\u0432\u044b\u0434\u0430\u0451\u0442<\/a>: 1, 1.<\/li>\n<li>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GCC 10.2, <a href=\"https:\/\/godbolt.org\/z\/q9oGz8\">\u0432\u044b\u0434\u0430\u0451\u0442<\/a>: 2, 1.<\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Clang \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: <\/p>\n<pre><code class=\"cpp\">&lt;source&gt;:6:26: warning: unsequenced modification and access to &#39;i&#39; [-Wunsequenced] printf(&quot;%d, %d\\n&quot;, i, i++);<\/code><\/pre>\n<p>  \u0412\u0438\u0434\u0438\u043c\u043e, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e. \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5, \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/b><\/p>\n<pre><code class=\"cpp\">template &lt;class ELFT&gt; void GNUStyle&lt;ELFT&gt;::printVersionSymbolSection(const ELFFile&lt;ELFT&gt; *Obj,                                                const Elf_Shdr *Sec) {    ....   Expected&lt;StringRef&gt; NameOrErr =       this-&gt;dumper()-&gt;getSymbolVersionByIndex(Ndx, IsDefault);   if (!NameOrErr) {     if (!NameOrErr) {       unsigned SecNdx = Sec - &amp;cantFail(Obj-&gt;sections()).front();       this-&gt;reportUniqueWarning(createError(           &quot;unable to get a version for entry &quot; + Twine(I) +           &quot; of SHT_GNU_versym section with index &quot; + Twine(SecNdx) + &quot;: &quot; +           toString(NameOrErr.takeError())));     }     Versions.emplace_back(&quot;&lt;corrupt&gt;&quot;);     continue;   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V571 Recurring check. The &#39;if (!NameOrErr)&#39; condition was already verified in line 4666. ELFDumper.cpp 4667<\/p>\n<p>  \u0412\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u041d\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6, \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f<\/b><\/p>\n<pre><code class=\"cpp\">void RewriteObjCFragileABI::RewriteObjCClassMetaData(   ObjCImplementationDecl *IDecl, std::string &amp;Result) {   ObjCInterfaceDecl *CDecl = IDecl-&gt;getClassInterface();    if (CDecl-&gt;isImplicitInterfaceDecl()) {     RewriteObjCInternalStruct(CDecl, Result);   }    unsigned NumIvars = !IDecl-&gt;ivar_empty()   ? IDecl-&gt;ivar_size()   : (CDecl ? CDecl-&gt;ivar_size() : 0);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#39;CDecl&#39; pointer was utilized before it was verified against nullptr. Check lines: 5275, 5284. RewriteObjC.cpp 5275<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <i>CDecl<\/i> \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u0435\u043b\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">if (CDecl-&gt;isImplicitInterfaceDecl())<\/code><\/pre>\n<p>  \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c:<\/p>\n<pre><code class=\"cpp\">(CDecl ? CDecl-&gt;ivar_size() : 0)<\/code><\/pre>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">if (CDecl &amp;&amp; CDecl-&gt;isImplicitInterfaceDecl())<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7, \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f<\/b><\/p>\n<pre><code class=\"cpp\">bool Sema::InstantiateClass(....) {   ....   NamedDecl *ND = dyn_cast&lt;NamedDecl&gt;(I-&gt;NewDecl);   CXXRecordDecl *ThisContext =       dyn_cast_or_null&lt;CXXRecordDecl&gt;(ND-&gt;getDeclContext());   CXXThisScopeRAII ThisScope(*this, ThisContext, Qualifiers(),                               ND &amp;&amp; ND-&gt;isCXXInstanceMember());   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#39;ND&#39; pointer was utilized before it was verified against nullptr. Check lines: 2803, 2805. SemaTemplateInstantiate.cpp 2803<\/p>\n<p>  \u0420\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u043f\u0430\u0441\u043d\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0438\u0437 \u043a\u043e\u0434\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/b><\/p>\n<pre><code class=\"cpp\">bool VerifyObject(llvm::yaml::Node &amp;N,                   std::map&lt;std::string, std::string&gt; Expected) {   ....   auto *V = llvm::dyn_cast_or_null&lt;llvm::yaml::ScalarNode&gt;(Prop.getValue());   if (!V) {     ADD_FAILURE() &lt;&lt; KS &lt;&lt; &quot; is not a string&quot;;     Match = false;   }   std::string VS = V-&gt;getValue(Tmp).str();   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V1004 The &#39;V&#39; pointer was used unsafely after it was verified against nullptr. Check lines: 61, 65. TraceTests.cpp 65<\/p>\n<p>  \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <i>V<\/i> \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u042d\u0442\u043e \u044f\u0432\u043d\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043e \u0447\u0451\u043c \u0434\u0430\u0436\u0435 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u043d\u0438 \u0432 \u0447\u0451\u043c \u043d\u0438 \u0431\u044b\u0432\u0430\u043b\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">auto *V = llvm::dyn_cast_or_null&lt;llvm::yaml::ScalarNode&gt;(Prop.getValue()); if (!V) {   ADD_FAILURE() &lt;&lt; KS &lt;&lt; &quot; is not a string&quot;;   Match = false;   return false; } std::string VS = V-&gt;getValue(Tmp).str();<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430<\/b><\/p>\n<pre><code class=\"cpp\">const char *tools::SplitDebugName(const ArgList &amp;Args, const InputInfo &amp;Input,                                   const InputInfo &amp;Output) {   if (Arg *A = Args.getLastArg(options::OPT_gsplit_dwarf_EQ))     if (StringRef(A-&gt;getValue()) == &quot;single&quot;)       return Args.MakeArgString(Output.getFilename());    Arg *FinalOutput = Args.getLastArg(options::OPT_o);   if (FinalOutput &amp;&amp; Args.hasArg(options::OPT_c)) {     SmallString&lt;128&gt; T(FinalOutput-&gt;getValue());     llvm::sys::path::replace_extension(T, &quot;dwo&quot;);     return Args.MakeArgString(T);   } else {     \/\/ Use the compilation dir.     SmallString&lt;128&gt; T(         Args.getLastArgValue(options::OPT_fdebug_compilation_dir));     SmallString&lt;128&gt; F(llvm::sys::path::stem(Input.getBaseInput()));     llvm::sys::path::replace_extension(F, &quot;dwo&quot;);     T += F;     return Args.MakeArgString(F);       \/\/ &lt;=   } }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V1001 The &#39;T&#39; variable is assigned but is not used by the end of the function. CommonArgs.cpp 873<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>T<\/i> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c\u0438 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">T += F; return Args.MakeArgString(T);<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10, \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e<\/b><\/p>\n<pre><code class=\"cpp\">typedef int32_t si_int; typedef uint32_t su_int;  typedef union {   du_int all;   struct { #if _YUGA_LITTLE_ENDIAN     su_int low;     su_int high; #else     su_int high;     su_int low; #endif \/\/ _YUGA_LITTLE_ENDIAN   } s; } udwords;  COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {   ....   if (d.s.low == 0) {     if (d.s.high == 0) {       \/\/ K X       \/\/ ---       \/\/ 0 0       if (rem)         *rem = n.s.high % d.s.low;       return n.s.high \/ d.s.low;     }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>V609 Mod by zero. Denominator &#39;d.s.low&#39; == 0. udivmoddi4.c 61<\/li>\n<li>V609 Divide by zero. Denominator &#39;d.s.low&#39; == 0. udivmoddi4.c 62<\/li>\n<\/ul>\n<p>  \u041d\u0435 \u0437\u043d\u0430\u044e \u043e\u0448\u0438\u0431\u043a\u0430 \u044d\u0442\u043e \u0438\u043b\u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0445\u0438\u0442\u0440\u0430\u044f \u0437\u0430\u0434\u0443\u043c\u043a\u0430, \u043d\u043e \u043a\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439. \u0415\u0441\u0442\u044c \u0434\u0432\u0435 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438 \u043e\u0434\u043d\u0430 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0431\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e. \u0427\u0442\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442?<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11, Copy-Paste<\/b><\/p>\n<pre><code class=\"cpp\">bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModeledExplicitly(....) {   ....   StringRef FName = II-&gt;getName();   ....   if (FName == &quot;postEvent&quot; &amp;&amp;       FD-&gt;getQualifiedNameAsString() == &quot;QCoreApplication::postEvent&quot;) {     return true;   }    if (FName == &quot;postEvent&quot; &amp;&amp;       FD-&gt;getQualifiedNameAsString() == &quot;QCoreApplication::postEvent&quot;) {     return true;   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V581 The conditional expressions of the &#39;if&#39; statements situated alongside each other are identical. Check lines: 3108, 3113. MallocChecker.cpp 3113<\/p>\n<p>  \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0431\u044b\u043b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0451\u043d. \u0412\u0442\u043e\u0440\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043b\u0438\u0431\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043b\u0438\u0431\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0430\u0447\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <a href=\"https:\/\/viva64.com\/ru\/pvs-studio-download\/?utm_source=habr&amp;utm_medium=banner&amp;utm_campaign=0771_Clang11_ru\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/04b\/0d5\/022\/04b0d5022b3a6cfadc4732dce7842da7.png\"><\/div>\n<p><\/a><br \/>  \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.viva64.com\/ru\/b\/0600\/\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438<\/a>. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PVS-Studio, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041e\u043d\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0437\u0434\u0435\u0441\u044c: &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0614\/\">\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PVS-Studio<\/a>&quot;. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. <\/p>\n<h2>\u0414\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0448\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/b\/0108\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 LLVM (Clang)<\/a> (\u0430\u0432\u0433\u0443\u0441\u0442 2011), <a href=\"http:\/\/www.viva64.com\/ru\/b\/0155\/\">\u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/a> (\u0430\u0432\u0433\u0443\u0441\u0442 2012), <a href=\"http:\/\/www.viva64.com\/ru\/b\/0446\/\">\u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/a> (\u043e\u043a\u0442\u044f\u0431\u0440\u044c 2016), <a href=\"https:\/\/www.viva64.com\/ru\/b\/0629\/\">\u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/a> (\u0430\u043f\u0440\u0435\u043b\u044c 2019)<\/li>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/b\/0425\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 GCC<\/a> (\u0430\u0432\u0433\u0443\u0441\u0442 2016), <a href=\"https:\/\/www.viva64.com\/ru\/b\/0727\/\">\u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/a> (\u0430\u043f\u0440\u0435\u043b\u044c 2020)<\/li>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/b\/0690\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Huawei Ark Compiler<\/a> (\u0434\u0435\u043a\u0430\u0431\u0440\u044c 2019)<\/li>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/b\/0363\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 .NET Compiler Platform (&quot;Roslyn&quot;)<\/a> (\u0434\u0435\u043a\u0430\u0431\u0440\u044c 2015), <a href=\"https:\/\/www.viva64.com\/ru\/b\/0622\/\">\u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/a> (\u0430\u043f\u0440\u0435\u043b\u044c 2019)<\/li>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/b\/0664\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Roslyn Analyzers<\/a> (\u0430\u0432\u0433\u0443\u0441\u0442 2019)<\/li>\n<li><a href=\"https:\/\/www.viva64.com\/ru\/b\/0492\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 PascalABC.NET<\/a> (\u043c\u0430\u0440\u0442 2017)<\/li>\n<\/ul>\n<p>  <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/525246\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/d5\/1k\/2e\/d51k2edrgxyrg5voswox_46pg3o.png\"><\/div>\n<p><\/a><br \/>  \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: Andrey Karpov. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/525246\/\">Checking Clang 11 with PVS-Studio<\/a>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/525248\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/525248\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b5\/636\/72e\/6b563672ef87abf5ca9d22c93877c079.png\" alt=\"PVS-Studio: \u0412\u0441\u0451 \u0435\u0449\u0451 \u0434\u043e\u0441\u0442\u043e\u0438\u043d!\"><\/div>\n<p>  \u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u042d\u0442\u043e \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043b\u044e\u0434\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f, \u0434\u043e\u0441\u0442\u043e\u0438\u043d \u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0437\u0432\u0430\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043b\u043e\u0432\u0446\u0430 \u0431\u0430\u0433\u043e\u0432 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c? \u0414\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043d\u0435 \u0441\u0442\u043e\u044f\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 PVS-Studio, \u0432\u043d\u043e\u0432\u044c \u0438 \u0432\u043d\u043e\u0432\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0430\u0436\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-312113","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312113","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=312113"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312113\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}