[cfe-dev] I get no reports from running "scan-build <args...> make -k

salvatore benedetto salvatore.benedetto at gmail.com
Thu Jun 27 01:55:17 PDT 2013


Thanks for your reply Mikhail.

I double checked that everything is in the same installation directory
but still nothing.

$ which scan-build
/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/scan-build

$ which clang++
/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/clang++

$ ls /home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/scanview.css
/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/scanview.css

$ ls /home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/sorttable.js
/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/sorttable.js

My makefile is as silly as

$ cat Makefile

test: test.cpp
clang++ test.cpp -o test

$ scan-build -o ./ make
scan-build: Using
'/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/clang' for
static analysis
clang++ test.cpp -o test
test.cpp:18:19: warning: division by zero is undefined [-Wdivision-by-zero]
    uint8_t i = 10/0;
                  ^~
1 warning generated.
scan-build: Removing directory
'/home/xxxx/programming/clang-check-test/2013-06-27-1' because it contains
no reports.
scan-build: No bugs found.

clang version is 3.3
host is Ubuntu 12.04

Thanks again,
Salvatore



On Thu, Jun 27, 2013 at 10:41 AM, Duglas Mikle <drongoa6 at yandex.ru> wrote:

>
> Hi Salvatore,
>
> please do following:
>
> $which clang++
> /usr/bin/clang++ (should be here. I hope that the limitation isn't
> mandatory, but it will be much easier)
>
> $*which scan-build*
>
> /usr/bin/scan-build
>
> *$ls /usr/bin/scanview.css*
>
> /usr/bin/scanview.css
>
> *$ls /usr/bin/sorttable.js*
>
> /usr/bin/sorttable.js
> All these files should be in place. If Yes, then your installation was
> successful.
> And next:
>
> export CXX=clang++
>
> then, verify your Makefile
> --
> all:
>     $(CXX) main.cpp hello.cpp factorial.cpp -o hello
> clean:
>     rm -rf hello
> --
> execute your command:
>
> $ scan-build -o ./ make
>
> In my case it helped. (Thanks to Ted and Anna).
> BR,
> Mikhail.
>
> 27.06.2013, 11:59, "salvatore benedetto" <salvatore.benedetto at gmail.com>:
>
> Hi,
>
> I am having the same problem.
>
> I moved everything under the directory where the binaries are installed
> as it works for Mikhail but I still don't get the report.
>
> Running scan-build on this test code
>
> int main(int argc, char** argv)
> {
>     uint8_t array[12];
>     uint8_t* ptr;
>     uint8_t i = 10/0;
>
>     array[3] = *ptr;
>
>     for (uint8_t i = 0; i < 13; i++) {
>         printf("%d\n", array[i]);
>         array[i] = 1;
>     }
>
>     printf("%d\n", ptr[1]);
>     ptr = array;
>
>     return 0;
> }
>
> $ scan-build --use-analyzer=`which c++-analyzer` -V -o . make
> scan-build: Using
> '/home/xxxx/programming/llvm-bld/Release+Debug+Asserts/bin/c++-analyzer'
> for static analysis
> clang++ test.cpp -o test
> test.cpp:18:19: warning: division by zero is undefined [-Wdivision-by-zero]
>     uint8_t i = 10/0;
>                   ^~
> 1 warning generated.
> scan-build: Removing directory '/home/xxxx/programming/clang-check-test/
> 2013-06-27-1' because it contains no reports.
> scan-build: No bugs found.
>
> Running it with strace show the following
>
> stat64("/home/xxxx/programming/clang-check-test/2013-06-27-1/failures",
> 0x94ea0c4) = -1 ENOENT (No such file or directory)
> write(1, "scan-build: Removing directory '"..., 118scan-build: Removing
> directory '/home/xxxx/programming/clang-check-test/2013-06-27-1' because
> it contains no reports.
> ) = 118
>
> For some reason failures is not created.
>
> Any hints?
>
> S.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130627/9c3a9d80/attachment.html>


More information about the cfe-dev mailing list