Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2015 14:27:12 -0800
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>, freebsd-toolchain@freebsd.org, Dimitry Andric <dim@freebsd.org>
Subject:   Re: clang and scanbuild
Message-ID:  <CAG=rPVdd7Qc0-2M7KEsNROCj%2BbRbK7XjLnCjywwrB83D6DCGYQ@mail.gmail.com>
In-Reply-To: <20150216214242.GA524@spindle.one-eyed-alien.net>
References:  <CAG=rPVc7nccxPSiBZXyHZ09d1gc597h_aok5vONtE07RvNz0-Q@mail.gmail.com> <08E18A70-59E0-441D-A705-0F3F3B7B9998@FreeBSD.org> <CAG=rPVcmQm8NXpqBG7JsDzkrUJEvMrvLVqoxyfb5bEHNWoenbw@mail.gmail.com> <20150216214242.GA524@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 16, 2015 at 1:42 PM, Brooks Davis <brooks@freebsd.org> wrote:

> On Mon, Feb 16, 2015 at 01:21:34PM -0800, Craig Rodrigues wrote:
> > On Wed, Feb 11, 2015 at 1:43 PM, Dimitry Andric <dim@freebsd.org> wrote:
> >
> > >
> > > Yes, choose either lang/clang-devel, or lang/clangXY, where XY is the
> > > version you are interested in.
> > >
> > >
> > > >   (2)  is there enough llvm source in FreeBSD that we can build this
> in
> > > >         FreeBSD instead of checking out llvm source?
> > >
> > > You can already run the analyzers with the clang executable in base,
> > > unless you built your world using WITHOUT_CLANG_FULL.  You do need perl
> > > installed, of course.
> > >
> > >
> > Nice!  I did this:
> >
> > pkg install lang/clang-devel
> > export PATH=$PATH:/usr/local/llvm-devel/bin
> > scan-build cc a.c
> >
> > scan-build: Using '/usr/local/llvm-devel/bin/clang' for static analysis
> > a.c:10:10: warning: Use of memory after it is freed
> >     a[5] ='b';
> >     ~~~~ ^
> > 1 warning generated.
> > scan-build: 1 bug found.
> > scan-build: Run 'scan-view /tmp/scan-build-2015-02-16-211517-60875-1' to
> > examine bug reports.
> >
> > scan-view /tmp/scan-build-2015-02-16-211517-60875-1
> > Traceback (most recent call last):
> >   File "/usr/local/llvm-devel/bin/scan-view", line 131, in <module>
> >     main()
> >   File "/usr/local/llvm-devel/bin/scan-view", line 128, in main
> >     run(port, options, root)
> >   File "/usr/local/llvm-devel/bin/scan-view", line 57, in run
> >     import ScanView
> > ImportError: No module named ScanView
> >
> >
> > It looks like some stuff for scan-view is missing from the port.  Do you
> > have any
> > ideas offhand what is missing?  It's not so important, because the
> > results of scan-build can be opened up in any web browser, independently
> of
> > scan-view.
>
> You should use the wrappers in /usr/local/bin (e.g. scan-view-devel) as
> they set up
> the environment so modules can be found.
>

Ah, OK!  scan-view-devel worked.  It might be nice to have a patch in the
port
which changes the message from scan-build to tell folks to invoke
scan-view-devel instead of scan-view.

--
Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVdd7Qc0-2M7KEsNROCj%2BbRbK7XjLnCjywwrB83D6DCGYQ>