[EXT] Re: [PATCH] build: enable static analyzer
Stephen Hemminger
stephen at networkplumber.org
Fri Jul 7 00:59:30 CEST 2023
On Fri, 15 Jul 2022 12:05:41 +0000
Amit Prakash Shukla <amitprakashs at marvell.com> wrote:
> Thanks Bruce for the review. Please find my comments in-line.
>
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson at intel.com>
> > Sent: Thursday, July 14, 2022 4:31 PM
> > To: Amit Prakash Shukla <amitprakashs at marvell.com>
> > Cc: dev at dpdk.org; Jerin Jacob Kollanukkaran <jerinj at marvell.com>;
> > thomas at monjalon.net; david.marchand at redhat.com;
> > dmitry.kozliuk at gmail.com; navasile at linux.microsoft.com;
> > dmitrym at microsoft.com
> > Subject: [EXT] Re: [PATCH] build: enable static analyzer
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Thu, Jul 14, 2022 at 12:57:22PM +0530, Amit Prakash Shukla wrote:
> > > This patch adds support to enable compiler static analyzer for gcc and
> > > clang.
> > >
> > > Signed-off-by: Amit Prakash Shukla <amitprakashs at marvell.com>
> > > ---
> > > config/meson.build | 14 ++++++++++++++
> > > doc/guides/prog_guide/index.rst | 1 +
> > > doc/guides/prog_guide/static_analyzer.rst | 21
> > +++++++++++++++++++++
> > > meson_options.txt | 2 ++
> > > 4 files changed, 38 insertions(+)
> > > create mode 100644 doc/guides/prog_guide/static_analyzer.rst
> > >
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 7f7b6c92fd..1154396326 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -440,6 +440,20 @@ if get_option('b_sanitize') == 'address' or
> > get_option('b_sanitize') == 'address
> > > endif
> > > endif
> > >
> > > +if get_option('static_analyzer')
> > > + if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.1.0')
> > > + add_project_arguments('-fanalyzer', language: 'c')
> >
> > Rather than checking for specific compiler versions, we should instead just
> > check for particular flags and use those.
>
> Sure, I will make the change as part of v2 patch.
Never saw a v2 of this patch??
More information about the dev
mailing list