Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/113957/?format=api
http://patches.dpdk.org/api/patches/113957/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220714072722.879156-1-amitprakashs@marvell.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220714072722.879156-1-amitprakashs@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220714072722.879156-1-amitprakashs@marvell.com", "date": "2022-07-14T07:27:22", "name": "build: enable static analyzer", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "13059baf22eb46e80db567ba7a3149aef7f0552f", "submitter": { "id": 2699, "url": "http://patches.dpdk.org/api/people/2699/?format=api", "name": "Amit Prakash Shukla", "email": "amitprakashs@marvell.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220714072722.879156-1-amitprakashs@marvell.com/mbox/", "series": [ { "id": 23992, "url": "http://patches.dpdk.org/api/series/23992/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23992", "date": "2022-07-14T07:27:22", "name": "build: enable static analyzer", "version": 1, "mbox": "http://patches.dpdk.org/series/23992/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/113957/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/113957/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CFC84A00C5;\n\tThu, 14 Jul 2022 09:27:52 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AA6D542836;\n\tThu, 14 Jul 2022 09:27:52 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id B8DEC41156\n for <dev@dpdk.org>; Thu, 14 Jul 2022 09:27:51 +0200 (CEST)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 26E3eqLI019044;\n Thu, 14 Jul 2022 00:27:50 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3habegrnnb-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 14 Jul 2022 00:27:50 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Thu, 14 Jul 2022 00:27:49 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Thu, 14 Jul 2022 00:27:49 -0700", "from localhost.localdomain (unknown [10.28.48.63])\n by maili.marvell.com (Postfix) with ESMTP id 45D713F704D;\n Thu, 14 Jul 2022 00:27:46 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding :\n content-type; s=pfpt0220; bh=cNpbahS8H/xzHAdeZ9bBYI4Vi0qOfoJp7k7LwjyctAY=;\n b=LCnjkemzGva7PCYJdtz8d7eKSLj5R9NgdWNSPZg+MRSmMJbraIPnlM9wiSQ7xzrCXtb/\n kEjIAuI6SIovmu/qUJ9pqkoxEU1sucImqWwGvgec95iVa8b5GmtJiNCSJ0bQnuI1Bxg3\n uET89hsv6rpbqhzAt/vuC35veXGF60ZoY1tW24+8yLk52mUAjedFw/DT75XnJgF0R59y\n ECpfa627/UORozxnaEFn1sUDPYo3qKzJE2hu9SzUCxBT6drIJ3MJW0FfVXeyo61vRoqd\n jlcJvkJGsphbsgnWe2OJbU9tubJ9SwH8m+JIP5Y0ankuS/T+SzY+20kBYBWrJhVH9H0d jA==", "From": "Amit Prakash Shukla <amitprakashs@marvell.com>", "To": "Bruce Richardson <bruce.richardson@intel.com>", "CC": "<dev@dpdk.org>, <jerinj@marvell.com>, <thomas@monjalon.net>,\n <david.marchand@redhat.com>, <dmitry.kozliuk@gmail.com>,\n <navasile@linux.microsoft.com>, <dmitrym@microsoft.com>,\n Amit Prakash Shukla <amitprakashs@marvell.com>", "Subject": "[PATCH] build: enable static analyzer", "Date": "Thu, 14 Jul 2022 12:57:22 +0530", "Message-ID": "<20220714072722.879156-1-amitprakashs@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "kK5eFbUKw189WmN9Os80YD_qhJEHXYRW", "X-Proofpoint-ORIG-GUID": "kK5eFbUKw189WmN9Os80YD_qhJEHXYRW", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1\n definitions=2022-07-14_04,2022-07-13_03,2022-06-22_01", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "This patch adds support to enable compiler static analyzer for\ngcc and clang.\n\nSigned-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>\n---\n config/meson.build | 14 ++++++++++++++\n doc/guides/prog_guide/index.rst | 1 +\n doc/guides/prog_guide/static_analyzer.rst | 21 +++++++++++++++++++++\n meson_options.txt | 2 ++\n 4 files changed, 38 insertions(+)\n create mode 100644 doc/guides/prog_guide/static_analyzer.rst", "diff": "diff --git a/config/meson.build b/config/meson.build\nindex 7f7b6c92fd..1154396326 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -440,6 +440,20 @@ if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address\n endif\n endif\n \n+if get_option('static_analyzer')\n+ if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.1.0')\n+ add_project_arguments('-fanalyzer', language: 'c')\n+ elif cc.get_id() == 'clang' and cc.version().version_compare('>=9.0.1')\n+ add_project_arguments('--analyze', language: 'c')\n+ add_project_arguments('-Xanalyzer', language: 'c')\n+ add_project_arguments('-analyzer-output=text', language: 'c')\n+ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'\n+ error('Static analysis not supported for current gcc/clang version.')\n+ else\n+ error('Compiler does not support static analysis')\n+ endif\n+endif\n+\n if get_option('default_library') == 'both'\n error( '''\n Unsupported value \"both\" for \"default_library\" option.\ndiff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst\nindex 8564883018..9f6d98904a 100644\n--- a/doc/guides/prog_guide/index.rst\n+++ b/doc/guides/prog_guide/index.rst\n@@ -76,4 +76,5 @@ Programmer's Guide\n lto\n profile_app\n asan\n+ static_analyzer\n glossary\ndiff --git a/doc/guides/prog_guide/static_analyzer.rst b/doc/guides/prog_guide/static_analyzer.rst\nnew file mode 100644\nindex 0000000000..11260eebe7\n--- /dev/null\n+++ b/doc/guides/prog_guide/static_analyzer.rst\n@@ -0,0 +1,21 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+ Copyright(c) 2022 Marvell\n+\n+Running Static Analyzer\n+========================\n+Static analyzer is a compiler feature which when enabled scans through the source\n+code to try and find various problems at compile-time, rather than at runtime.\n+\n+Static analyzer is a part of clang (9.0.1+) and GCC (10.1.0+).\n+\n+`GCC Static analyzer document\n+<https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Static-Analyzer-Options.html>`_\n+\n+`Clang static analyzer document\n+<https://releases.llvm.org/9.0.1/tools/clang/docs/ClangStaticAnalyzer.html>`_\n+\n+Enabling 'Static analyzer' is done by passing the -Dstatic_analyzer=true option to\n+the meson build system. By-default static analyzer is disabled.\n+\n+Example::\n+ - meson setup -Dstatic_analyzer=true <build_dir>\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 7c220ad68d..fde9a579a0 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -48,3 +48,5 @@ option('tests', type: 'boolean', value: true, description:\n 'build unit tests')\n option('use_hpet', type: 'boolean', value: false, description:\n 'use HPET timer in EAL')\n+option('static_analyzer', type: 'boolean', value: false, description:\n+ 'Compile time static analyses for gcc-10.1.0+ and clang-9.0.1+')\n", "prefixes": [] }{ "id": 113957, "url": "