Re: [Openocd-development] clang static analyzer
Øyvind Harboe wrote: > I upgraded to Ubuntu 11.10 from Ubuntu 11.04 and now it works :-) > > Looks like this is bleeding edge stuff... Not really, it is more likely just not something that Canonical cares so much about. //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
I upgraded to Ubuntu 11.10 from Ubuntu 11.04 and now it works :-) Looks like this is bleeding edge stuff... -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
On 10/21/2011 10:40 AM, Øyvind Harboe wrote: Where does the output go? It should go in a directory named scan-build--MM-DD-n/, where n starts from 1. If I recall correctly, that directory ended up in the directory I ran scan-build from. scan-build ./configure --enable-maintainer-mode --enable-dummy --disable-werror scan-build make ... make[2]: Leaving directory `/home/oyvind/openocd' make[1]: Leaving directory `/home/oyvind/openocd' scan-build: Removing directory '/tmp/scan-build-2011-10-21-1' because it contains no reports. I got the same "contains no reports" after ./configure (which makes some sense), but not after make. I ran it on Ubuntu 10.04 with LLVM and Clang from source, using the instructions in the section "On Unix-like Systems" here: http://clang.llvm.org/get_started.html#build I also configured with --enable-maintainer-mode only. Perhaps to start you can try that and see if you get a report? Marti ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
Hmm It doesn't work here. Any tips? Where does the output go? scan-build ./configure --enable-maintainer-mode --enable-dummy --disable-werror scan-build make ... make[2]: Leaving directory `/home/oyvind/openocd' make[1]: Leaving directory `/home/oyvind/openocd' scan-build: Removing directory '/tmp/scan-build-2011-10-21-1' because it contains no reports. This is with Ubuntu. -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
> http://clang-analyzer.llvm.org/index.html > > In short, it's very slow (took over an hour to get through with OpenOCD on > my machine), and it's susceptible to false positives. An hour is not the biggest problem if it saves a bunch of maintainer time. Can we choose some minimum threshold for what we'll accept in terms of errors like we do for gcc(-Werror -Wall is minimum acceptable for patches now). -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
On 10/19/2011 03:51 AM, Jon Povey wrote: openocd-development-boun...@lists.berlios.de wrote: I'd like to see patches having to pass clang static analyzer unscathed before they're ready for review :-) I had a quick look at that output, interesting. Some looked like real bugs, but others it seems clang was getting it wrong.. like if (ptr == NULL) checks which it thought failed, but then it complained about a null ptr dereference. It seemed to get if (!ptr) right though, which I think is preferred linux kernel style. There are some other issues which might make passing the static analyzer be a bad prerequisite for patches. See "Important Points to Consider", here: http://clang-analyzer.llvm.org/index.html In short, it's very slow (took over an hour to get through with OpenOCD on my machine), and it's susceptible to false positives. Best, Marti ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
Patches pushed Gerrit most welcome! :-) -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
openocd-development-boun...@lists.berlios.de wrote: > Cool! I agree, it looks cool. > I'd like to see patches having to pass clang static analyzer > unscathed before they're ready for review :-) I had a quick look at that output, interesting. Some looked like real bugs, but others it seems clang was getting it wrong.. like if (ptr == NULL) checks which it thought failed, but then it complained about a null ptr dereference. It seemed to get if (!ptr) right though, which I think is preferred linux kernel style. -- Jon Povey jon.po...@racelogic.co.uk Racelogic is a limited company registered in England. Registered number 2743719 . Registered Office Unit 10, Swan Business Centre, Osier Way, Buckingham, Bucks, MK18 1TB . The information contained in this electronic mail transmission is intended by Racelogic Ltd for the use of the named individual or entity to which it is directed and may contain information that is confidential or privileged. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email so that the sender's address records can be corrected. The views expressed by the sender of this communication do not necessarily represent those of Racelogic Ltd. Please note that Racelogic reserves the right to monitor e-mail communications passing through its network ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
Cool! Could I ask you to work through and fix some of the bugs and submit them to Gerrit? I'd like to see patches having to pass clang static analyzer unscathed before they're ready for review :-) -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
I ran scan-build from today's llvm and clang trunks on openocd commit 0dac042a107f000936995ea468c3fa02b9896fb6 as follows: $ scan-build ./configure --enable-maintainer-mode $ scan-build make The result was a directory full of HTML reports. They're readable in firefox, but the output said the right way to look at them is with scan-view. Even tgz'ed, the output is 5.4 MB, so I'm not sure if it's appropriate for inclusion as an attachment on this list. I'll leave it here for now: http://static.leaflabs.com/mbolivar/tmp/scan-build-2011-10-18-1.tgz Marti On 10/18/2011 01:18 PM, Øyvind Harboe wrote: Does anyone want to take clang static analyzer for a spin on openocd? http://clang-analyzer.llvm.org/scan-build.html ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
On Tue, Oct 18, 2011 at 9:46 PM, Spencer Oliver wrote: > On 18/10/2011 18:18, Øyvind Harboe wrote: >> >> Does anyone want to take clang static analyzer for a spin on openocd? >> >> http://clang-analyzer.llvm.org/scan-build.html >> > > seems jenkins already has a plugin for that :) > https://wiki.jenkins-ci.org/display/JENKINS/Clang+Scan-Build+Plugin Can we have it? :-) Perhaps we can add that as an additional lint/analysis check step so that we can weed out more. -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] clang static analyzer
On 18/10/2011 18:18, Øyvind Harboe wrote: Does anyone want to take clang static analyzer for a spin on openocd? http://clang-analyzer.llvm.org/scan-build.html seems jenkins already has a plugin for that :) https://wiki.jenkins-ci.org/display/JENKINS/Clang+Scan-Build+Plugin Spen ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
[Openocd-development] clang static analyzer
Does anyone want to take clang static analyzer for a spin on openocd? http://clang-analyzer.llvm.org/scan-build.html -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development