From owner-freebsd-testing@FreeBSD.ORG Mon Feb 16 22:27:20 2015 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A0EAD57; Mon, 16 Feb 2015 22:27:20 +0000 (UTC) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FCA2BBF; Mon, 16 Feb 2015 22:27:19 +0000 (UTC) Received: by labms9 with SMTP id ms9so26483064lab.10; Mon, 16 Feb 2015 14:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=WgBoLkj0HloBaR+sC4s3xMIhpsEmNOkORy6iTF2q5a4=; b=MSudUAICX2RR2NXPL3p2jmEEzFNSP67rErmQxwKsPYbqlCc+0nMXpElpPGvgPk2kWA DtmpOonQwUNrIc1JJ6/RMEKS96g8QXF5PnW8YXV2N/x6WXhbhAZL+ieJ3srnw0GFmRHL QF1WHN7qtmS4QhB1d0fhGjvmntiiHEJetNIco6jIo6OLW7vUrJ+7Q0Rhn481N3N2pa0y Kug5o6XamTdYmsbsFuUM3qb0Ox4iwSpNsdOUyvb7+eGIR4XZ3cfqQ9mw0pnzwaj1zgZv OIGk4EmJuufniSYAcWK1HWxDfNoPxiZbjPzl2wfcEXYhB1UGtYSDqGcDkyRcLLks7Ouu cMUQ== MIME-Version: 1.0 X-Received: by 10.152.26.199 with SMTP id n7mr25416584lag.29.1424125632504; Mon, 16 Feb 2015 14:27:12 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Mon, 16 Feb 2015 14:27:12 -0800 (PST) In-Reply-To: <20150216214242.GA524@spindle.one-eyed-alien.net> References: <08E18A70-59E0-441D-A705-0F3F3B7B9998@FreeBSD.org> <20150216214242.GA524@spindle.one-eyed-alien.net> Date: Mon, 16 Feb 2015 14:27:12 -0800 X-Google-Sender-Auth: yMufYEvxZok8Kuc4rXpyDxIYOQ0 Message-ID: Subject: Re: clang and scanbuild From: Craig Rodrigues To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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 22:27:20 -0000 On Mon, Feb 16, 2015 at 1:42 PM, Brooks Davis 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 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 > > 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