{"id":282436,"date":"2016-12-13T17:30:03","date_gmt":"2016-12-13T14:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282436","title":{"rendered":"\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c PVS-Studio \u0432 Eclipse CDT (macOS)"},"content":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0438 PVS-Studio \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 IDE \u043f\u043e\u0434 Linux (<a href=\"https:\/\/habrahabr.ru\/post\/316670\/\">Eclipse<\/a>, <a href=\"https:\/\/habrahabr.ru\/post\/316720\/\">Anjuta<\/a>), \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c PVS-Studio \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 Eclipse \u043f\u043e\u0434 macOS. \u041d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 PVS-Studio \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043e\u0434 macOS. \u041d\u0443 \u0447\u0442\u043e \u0436, \u0437\u0430\u0442\u043a\u043d\u0435\u043c \u043f\u043e\u043a\u0430 \u044d\u0442\u0443 \u0431\u0440\u0435\u0448\u044c. <\/p>\n<p>  <\/p>\n<h2 id=\"dano\">\u0414\u0430\u043d\u043e:<\/h2>\n<p>  <\/p>\n<ul>\n<li>macOS Sierra<\/li>\n<li>Eclipse Luna + <a href=\"http:\/\/gnuarmeclipse.github.io\">GNU ARM Eclipse Plug-ins<\/a><\/li>\n<li><a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\">GNU ARM Embedded Toolchain<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430:<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio-download-linux\/\">PVS-Studio<\/a><a name=\"habracut\"><\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a Eclipse \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0441 Linux<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Docker<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Docker, \u0442.\u043a. \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u043b\u0430 \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0432\u044f\u0437\u043a\u0443 NFS+SSH, \u043d\u043e, \u0431\u043e\u044e\u0441\u044c, \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0423 Docker \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0438 \u043c\u0438\u043d\u0443\u0441\u044b. \u0412\u0435\u0440\u043d\u0435\u0435 \u043e\u0434\u0438\u043d \u0436\u0438\u0440\u043d\u044b\u0439 \u2014 \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u043f\u0440\u043e Docker. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u0432\u0432\u043e\u0434\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u0434\u0443\u043c\u043a\u0438 \u0443\u0448\u043b\u043e \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0434\u043d\u044f.<\/p>\n<p>  <\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u0439\u043c\u0435\u0442 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 Eclipce.<\/p>\n<p>  <\/p>\n<h2 id=\"skripty\">\u0421\u043a\u0440\u0438\u043f\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043f\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">run_once.sh<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/sh echo &quot;Fetching last timurey\/docker-pvs image&quot; \/usr\/local\/bin\/docker pull timurey\/docker-pvs:latest echo &quot;Testing&quot; \/usr\/local\/bin\/docker run -i timurey\/docker-pvs echo &quot;Ready to run&quot;<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">eclipse-pvs.sh<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash  debug() { if [ &quot;$debug&quot; == &quot;1&quot; ]; then     d=$1     echo $d fi } usage() {     echo &quot;usage: eclipse-pvs [[-w &lt;path&gt; -n &lt;name&gt; [-d]]| -h]&quot;     echo &quot;where args:&quot;     echo &quot;      -w(--workspace)   &lt;path&gt;    set path to workspace directory&quot;     echo &quot;      -n(--projectname) &lt;name&gt;    project name in eclipse&quot;     echo &quot;      -c(--config)      &lt;config&gt;  config descriptor (Debug or Release)&quot;     echo &quot;      -d(--debug)                 some debuging info&quot;     echo &quot;      -h(--help)                  show this message&quot; }  clean () { debug &quot;Clean&quot; make -f makefile clean     exit }  analyze() {     debug &quot;running command:&quot;     debug &quot;\/usr\/local\/bin\/docker run --security-opt seccomp:\\&quot;&quot;&quot;$workspace\/docker-pvs\/strace.json&quot;&quot;\\&quot; -v \\&quot;&quot;&quot;$workspace&quot;&quot;\\&quot;:\/root\/workspace -i timurey\/docker-pvs \/root\/workspace\/docker-pvs\/client.sh -n \\&quot;&quot;&quot;$projectname&quot;&quot;\\&quot; -c \\&quot;&quot;&quot;$config&quot;&quot;\\&quot;&quot;     \/usr\/local\/bin\/docker run --security-opt seccomp:&quot;$workspace\/docker-pvs\/strace.json&quot; -v &quot;$workspace&quot;:\/root\/workspace -i timurey\/docker-pvs \/root\/workspace\/docker-pvs\/client.sh -n &quot;$projectname&quot; -c &quot;$config&quot;     exit }  while [ &quot;$1&quot; != &quot;&quot; ]; do     case $1 in         -w | --workspace )      shift                 workspace=$1                                 ;;         -c | --config )         shift                 config=$1                                 ;;         -n | --projectname )    shift                 projectname=$1                                 ;;         -d | --debug )                           debug=1                                 ;;         -h | --help )           usage                                 exit                                 ;;         clean )                 clean                                 exit     esac     shift done  if [ &quot;$workspace&quot; != &quot;&quot; ]; then     if [ &quot;$projectname&quot; != &quot;&quot; ]; then         if [ &quot;$config&quot; != &quot;&quot; ]; then     debug &quot;workspace path: \\&quot;$workspace\\&quot;&quot;     debug &quot;project name: \\&quot;$projectname\\&quot;&quot;     debug &quot;config description: \\&quot;$config\\&quot;&quot;     analyze         else             echo &quot;config description is not defined&quot; &gt;&amp;2             exit         fi     else         echo &quot;project name path is not defined&quot; &gt;&amp;2         exit     fi else     echo &quot;workspace is not defined&quot; &gt;&amp;2     exit fi <\/code><\/pre>\n<\/div>\n<\/div>\n<p>   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">client.sh<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash  while [ &quot;$1&quot; != &quot;&quot; ]; do     case $1 in         -n | --projectname )    shift                 projectname=$1                                 ;;         -c | --config )         shift                 config=$1                                 ;;     esac     shift done  if [ &quot;$projectname&quot; != &quot;&quot; ]; then     TEMPLOG=$(tempfile)     cd &quot;\/root\/workspace\/$projectname\/$config&quot;     # \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;&amp;1 | sed '\/strace: umovestr:\/d' -     pvs-studio-analyzer analyze --compiler arm-none-eabi-gcc -o &quot;$TEMPLOG&quot; --cfg \/root\/workspace\/docker-pvs\/pvs-studio.cfg      # \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; fi<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">strace.json<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>{   &quot;defaultAction&quot;: &quot;SCMP_ACT_ALLOW&quot;,   &quot;syscalls&quot;: [     {       &quot;name&quot;: &quot;strace&quot;,       &quot;action&quot;: &quot;SCMP_ACT_ERRNO&quot;     }   ] } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">pvs-studio.cfg<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>exclude-path = \/usr\/arm-none-eabi\/include platform = linux64 preprocessor = gcc analysis-mode = 4 sourcetree-root = \/root\/workspace<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 Eclipse \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f workspace, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0451 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e docker-pvs \u0438 \u0441\u043b\u043e\u0436\u0438\u043c \u0442\u0443\u0434\u0430 \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0414\u0435\u043b\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ chmod +x run_once.sh eclipse-pvs.sh client.sh<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"eclipse\">Eclipse<\/h3>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0416\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0431\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u0432 Eclipse \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u0412 \u043e\u0431\u0440\u0430\u0437\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 5-2016-q3 (\u043e\u0442 2016-09-19), \u0442\u0430\u043a \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u043b\u044f macOS \u0432\u0435\u0440\u0441\u0438\u044e 5-2016-q3 (\u043e\u0442 2016-09-28) c \u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\/+download\">launchpad.net<\/a><\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Debug<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Manage configurations<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrastorage.org\/files\/78c\/526\/52a\/78c52652a04a4684afe2d3627ef1eb57.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/eb7\/360\/ffe\/eb7360ffec204e8492066657df209a6d.png\"\/><\/a><br \/>  <em>\u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432 \u043e\u043f\u0446\u0438\u044f\u0445 \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<p><strong>1.<\/strong> \u0421\u043d\u0438\u043c\u0430\u0435\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 &quot;Use default build command<\/p>\n<p>  <\/p>\n<p><strong>2.<\/strong> \u0412 Build command \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">${workspace_loc}\/docker-pvs\/eclipse-pvs.sh -w &quot;${workspace_loc}&quot; -n ${ProjName} -c Debug -d<\/code><\/pre>\n<p>  <\/p>\n<p><strong>3.<\/strong> \u041e\u0442\u043c\u0435\u0447\u0430\u0435\u043c Generate Makefiles automatically<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">C\/C++ Build<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrastorage.org\/files\/ed6\/746\/7d7\/ed67467d784e4cfabf02ccdb55f9141c.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c1a\/ab5\/73c\/c1aab573c7444d619a26fe0ccdc3abdd.png\"\/><\/a><br \/>  <em>\u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u0435\u043b\u0430\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u2318+B<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrastorage.org\/files\/457\/75e\/88c\/45775e88c82448e88dc642aa6af2a482.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/399\/a8c\/9b2\/399a8c9b2c5448f2b7e3f7c8c88a8982.png\"\/><\/a><br \/>  <em>\u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"kak-eto-rabotaet\">\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430<\/p>\n<p>  <\/p>\n<pre><code>${workspace_loc}\/docker-pvs\/eclipse-pvs -w &quot;${workspace_loc}&quot; -n ${ProjName} -c Debug -d<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>-w \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e workspace<\/li>\n<li>-n \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <\/li>\n<li>-c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443<\/li>\n<li>-d \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <code>eclipse-pvs.sh<\/code> \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 docker<\/p>\n<p>  <\/p>\n<pre><code>\/usr\/local\/bin\/docker run --security-opt seccomp:&quot;$workspace\/docker-pvs\/strace.json&quot; -v &quot;$workspace&quot;:\/root\/workspace -i timurey\/docker-pvs \/root\/workspace\/docker-pvs\/client.sh -n &quot;$projectname&quot; -c &quot;$config&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>&#8212;security-opt seccomp: \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e strace \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438). \u041f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 strace.json<\/li>\n<li>-v \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e workspace \u0438\u0437 macOS \u0432 \/root\/workspace \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 client.sh \u0438 pvs-studio.cfg)<\/li>\n<li>-i \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u0440\u0430\u0437 timurey\/docker-pvs, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441 hub.docker.com<\/li>\n<li>\/root\/workspace\/docker-pvs\/client.sh \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 pvs-studio \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0441\u0430\u043c:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Dockerfile<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>FROM ubuntu:14.04 RUN apt-get update RUN apt-get install -y strace software-properties-common cmake wget RUN add-apt-repository ppa:team-gcc-arm-embedded\/ppa RUN apt-get update RUN apt-get install -y gcc-arm-embedded RUN wget http:\/\/files.viva64.com\/pvs-studio-6.11.20138.1-amd64.deb RUN dpkg -i pvs-studio-6.11.20138.1-amd64.deb RUN rm pvs-studio-6.11.20138.1-amd64.deb RUN echo Asia\/Yekaterinburg &gt;\/etc\/timezone &amp;&amp; ln -sf \/usr\/share\/zoneinfo\/Asia\/Yekaterinburg \/etc\/localtime &amp;&amp; dpkg-reconfigure -f noninteractive tzdata<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h2 id=\"vmesto-zaklyucheniya\">\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e web \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. Docker \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 C\/C++, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0434 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b.<\/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\/317518\/\"> https:\/\/habrahabr.ru\/post\/317518\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0438 PVS-Studio \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 IDE \u043f\u043e\u0434 Linux (<a href=\"https:\/\/habrahabr.ru\/post\/316670\/\">Eclipse<\/a>, <a href=\"https:\/\/habrahabr.ru\/post\/316720\/\">Anjuta<\/a>), \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c PVS-Studio \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 Eclipse \u043f\u043e\u0434 macOS. \u041d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 PVS-Studio \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043e\u0434 macOS. \u041d\u0443 \u0447\u0442\u043e \u0436, \u0437\u0430\u0442\u043a\u043d\u0435\u043c \u043f\u043e\u043a\u0430 \u044d\u0442\u0443 \u0431\u0440\u0435\u0448\u044c. <\/p>\n<p>  <\/p>\n<h2 id=\"dano\">\u0414\u0430\u043d\u043e:<\/h2>\n<p>  <\/p>\n<ul>\n<li>macOS Sierra<\/li>\n<li>Eclipse Luna + <a href=\"http:\/\/gnuarmeclipse.github.io\">GNU ARM Eclipse Plug-ins<\/a><\/li>\n<li><a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\">GNU ARM Embedded Toolchain<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430:<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio-download-linux\/\">PVS-Studio<\/a><br \/>\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-282436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282436","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=282436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}