From owner-freebsd-testing@FreeBSD.ORG Mon Feb 16 21:42:48 2015 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A30834; Mon, 16 Feb 2015 21:42:48 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 9EFD86AB; Mon, 16 Feb 2015 21:42:48 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 913E25A9F25; Mon, 16 Feb 2015 21:42:42 +0000 (UTC) Date: Mon, 16 Feb 2015 21:42:42 +0000 From: Brooks Davis To: Craig Rodrigues Subject: Re: clang and scanbuild Message-ID: <20150216214242.GA524@spindle.one-eyed-alien.net> References: <08E18A70-59E0-441D-A705-0F3F3B7B9998@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-testing@freebsd.org" , freebsd-toolchain@freebsd.org, Dimitry Andric X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 21:42:48 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 16, 2015 at 01:21:34PM -0800, Craig Rodrigues wrote: > On Wed, Feb 11, 2015 at 1:43 PM, Dimitry Andric wrote: >=20 > > > > 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: >=20 > pkg install lang/clang-devel > export PATH=3D$PATH:/usr/local/llvm-devel/bin > scan-build cc a.c >=20 > 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] =3D'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. >=20 > 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 > 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 >=20 >=20 > 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 the= y set up the environment so modules can be found. -- Brooks --/04w6evG8XlLl3ft Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTiZFEACgkQXY6L6fI4GtQmAgCfd5klQkm0IfZPpthxkE9YZhN2 pfoAnivqwzKM5mXZ8gKxYgaPcI7HJ7d/ =rwag -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft--