{"id":281886,"date":"2016-12-02T09:30:05","date_gmt":"2016-12-02T06:30:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=281886"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=281886","title":{"rendered":"\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c PVS-Studio \u0432 Eclipse CDT (Linux)"},"content":{"rendered":"<p>\u041d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/316484\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio<\/a> \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043c\u0435\u043d\u044f \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0432 Eclipse CDT. \u0410 \u0442\u043e \u0434\u043b\u044f CLion\/QtCreator\/etc <a href=\"http:\/\/www.viva64.com\/ru\/m\/0036\/#ID0EBCCI\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a<\/a>, \u0430 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0445 \u043e\u0431\u043e\u0448\u043b\u0438 \ud83d\ude42 \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c: Eclipse IDE for C\/C++ Developers, Version: Neon.1a Release (4.6.1), Build id: 20161007-1200 \u0438 PVS-Studio 6.11.20138.1. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0432\u044b\u0437\u043e\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 (\u043e \u043d\u0451\u043c \u043f\u043e\u0437\u0436\u0435) \u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443. \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">External Tools Configurations \/ Main<\/b><\/p>\n<div class=\"spoiler_text\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b8f\/651\/c83\/b8f651c83086e576a317dfebd7f8d066.jpg\" width=\"792\" height=\"649\"\/>  <\/div>\n<\/div>\n<p>  \u0418 \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u00abAllocate console\u00bb:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">External Tools Configurations \/ Common<\/b><\/p>\n<div class=\"spoiler_text\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/64d\/dd5\/8f5\/64ddd58f550f8909133cb6268a883df7.jpg\" width=\"792\" height=\"649\"\/>  <\/div>\n<\/div>\n<p>  \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u043b\u0438\u043f\u0441\u043e\u0432\u0441\u043a\u0438\u043c \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u043c, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Run as External Tool<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"http:\/\/xxo.su\/resizer\/i\/d\/e\/31a62c90.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/363\/c9d\/6e9\/363c9d6e9f47bc371040ffbca7841980.png\" width=\"800\" height=\"569\"\/><\/a>  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438. \u0421\u043f\u043e\u0441\u043e\u0431 \u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442, \u0442\u043e \u0438\u0434\u0451\u043c \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b External Builder:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">C\/C++ Build<\/b><\/p>\n<div class=\"spoiler_text\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dc2\/69b\/f93\/dc269bf93a2c1dcf3fc69cde37fc26df.jpg\" width=\"800\" height=\"620\"\/>  <\/div>\n<\/div>\n<p>  \u041a\u043b\u044e\u0447 &quot;-k&quot; Eclipse \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 &quot;-k all&quot;, \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u2014 \u0441 &quot;-k clean&quot;.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435, \u043f\u043b\u044e\u0441 \u0432\u044b\u0432\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f Eclipse \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c \u0432 \u043e\u043a\u043d\u0435 \u00abProblems\u00bb:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Run as Builder<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"http:\/\/xxo.su\/resizer\/i\/7\/2\/35ae2b56.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/847\/69f\/4eb\/84769f4ebaa6b68107d2da4291cd822c.png\" width=\"800\" height=\"595\"\/><\/a>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442:  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh  # \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a External Tool, \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c `make clean`: if [ -z &quot;$1&quot; ]; then     make -f makefile clean fi  # \u0432\u044b\u0437\u043e\u0432 \u0438\u0437 \u0431\u0438\u043b\u0434\u0435\u0440\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043b\u0438: if [ &quot;$2&quot; = &quot;clean&quot; ]; then     make -f makefile clean    # \u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e:     exit fi  # \u043d\u0435 clean \u0438\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u043a\u0430\u043a External Tool - \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442: TEMPLOG=$(tempfile)  # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043e\u0448\u043c\u0451\u0442\u043a\u0438 `strace`, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445: pvs-studio-analyzer trace -- make -f makefile all 2&gt;&1 | sed '\/strace: umovestr:\/d' - pvs-studio-analyzer analyze -o &quot;$TEMPLOG&quot;  # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u0430: RC=$(plog-converter -t errorfile &quot;$TEMPLOG&quot; | sed '\/The documentation for all\/d' -) rm -f &quot;$TEMPLOG&quot; echo &quot;$RC&quot;<\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430 \u0432\u0441\u0451. \u041d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0435\u0449\u0451 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u043e\u043d\u044f\u043b\u043e\u0441\u044c, \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043c \u0438 \u0432\u044b\u043b\u0435\u0437\u0443\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u0434\u043e\u0434\u0435\u043b\u043a\u0438. \u041d\u043e \u043e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430.<\/p>\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:\/\/habrahabr.ru\/post\/316670\/\"> https:\/\/habrahabr.ru\/post\/316670\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/316484\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio<\/a> \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043c\u0435\u043d\u044f \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0432 Eclipse CDT. \u0410 \u0442\u043e \u0434\u043b\u044f CLion\/QtCreator\/etc <a href=\"http:\/\/www.viva64.com\/ru\/m\/0036\/#ID0EBCCI\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a<\/a>, \u0430 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0445 \u043e\u0431\u043e\u0448\u043b\u0438 \ud83d\ude42 \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c: Eclipse IDE for C\/C++ Developers, Version: Neon.1a Release (4.6.1), Build id: 20161007-1200 \u0438 PVS-Studio 6.11.20138.1. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.  <\/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-281886","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281886","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=281886"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281886\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}