From owner-freebsd-toolchain@FreeBSD.ORG Mon Feb 16 21:21:43 2015 Return-Path: Delivered-To: freebsd-toolchain@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 57A87A8E; Mon, 16 Feb 2015 21:21:43 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) (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 E442923F; Mon, 16 Feb 2015 21:21:42 +0000 (UTC) Received: by lbiw7 with SMTP id w7so931690lbi.10; Mon, 16 Feb 2015 13:21:35 -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=Sb9hf3lIfu+zKofVucRQWehw0gytfOuI964widOYMKY=; b=LkkOZ2A72BLCZCSOvs7Ke42d/BT2wsUghd914aB3+CUz8iTDckscJomCc3mAes5YVP Y55+yNZ66mLLMfBGD5Hg4ZUsEKnPux0xzmvpkGJodZTbY+JA9ENct/HWTNW9Ea2PT2r7 tcwTYdEMKDQYZULne22YcmH7JiTVXARw0r7lXrVbuaupdY1tVD+a+Bl0FYz5jtwDWXht cmeLR+7J0F7LdXYPrqjCgisMNDcMv9W7XJFhv4xIIECZ9KzTB9bwxW8/a8VqFrpG3Gjq kBd+2qLIZEbyM5ilqgu+nqiTWJw2/M3UjAcfERISqNITS1tiSMAPWCcREcvR9XPGmerJ Cdvw== MIME-Version: 1.0 X-Received: by 10.112.202.227 with SMTP id kl3mr25548202lbc.81.1424121695062; Mon, 16 Feb 2015 13:21:35 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Mon, 16 Feb 2015 13:21:34 -0800 (PST) In-Reply-To: <08E18A70-59E0-441D-A705-0F3F3B7B9998@FreeBSD.org> References: <08E18A70-59E0-441D-A705-0F3F3B7B9998@FreeBSD.org> Date: Mon, 16 Feb 2015 13:21:34 -0800 X-Google-Sender-Auth: 7oI7N4wB_mYS6LUbR5PQeT0UsR8 Message-ID: Subject: Re: clang and scanbuild From: Craig Rodrigues To: Dimitry Andric 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 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 21:21:43 -0000 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. Would it be possible to include scan-build somwehere under /usr/src/contrib/llvm in the FreeBSD source tree? It seems like it is handy to have. However, if it is better to only have it in the port and not in src, I understand. -- Craig -- Craig