llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.46k stars 11.77k forks source link

scan-build doesn't seem to do anything #14259

Open llvmbot opened 12 years ago

llvmbot commented 12 years ago
Bugzilla Link 13887
Version unspecified
OS AIX
Reporter LLVM Bugzilla Contributor

Extended Description

I have build llvm / clang for AIX, which wasn't exactly a trivial occupation. The same applied to installing it. But in the end I succeeded. Before trying to make it work on AIX, I tested it on Linux and was impressed by the issues it found. Building it there went without a glitch. Now, when I try to use scan-build on the RS6000 machine (AIX), I get the following result:

../build> scan-build -v make scan-build: Emitting reports for this run to '/tmp/scan-build-2012-09-20-2'. xlC -c ../main.cpp xlC -c ../work.cpp "../work.cpp", line 42.18: 1540-1102 (W) "ptr" might be used before it is set. xlC -c ../obsc.cpp xlC -c ../entry.cpp xlC -o msae main.o work.o obsc.o entry.o scan-build: Removing directory '/tmp/scan-build-2012-09-20-2' because it contains no reports.

I deliberately put in an error, which is detected by xlC, but not by scan-build. scan-build on Linux detects it as well.

Then I tried:

../src> clang -v -v --analyze work.cpp clang version 3.1 (branches/release_31) Target: powerpc-ibm-aix6.1.0.0 Thread model: posix "" -cc1 -triple powerpc-ibm-aix6.1.0.0 -analyze -disable-free -main-file-name work.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-ipa=inlining -analyzer-checker=core -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-linker-version 0706 -momit-leaf-frame-pointer -v -v -resource-dir ../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /ccvunix/cdndev/user/cdndadm/Playground/msae -ferror-limit 19 -fmessage-length 170 -mstackrealign -fno-signed-char -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o work.plist -x c++ work.cpp error: unable to execute command: No such file or directory error: clang frontend command failed due to signal (use -v to see invocation) note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information. error: unable to execute command: No such file or directory note: diagnostic msg: Error generating preprocessed source(s).

What struck me was the empty quote's at the start of the command output. When trying this on the Linux box, the quote's were 'filled' with "/usr/bin/clang". So I copied this command output to the command line and filled the empty qoute's with "/usr/local/bin/clang". That worked.

../src> "/usr/local/bin/clang" -cc1 -triple powerpc-ibm-aix6.1.0.0 -analyze -disable-free -main-file-name work.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-ipa=inlining -analyzer-checker=core -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-linker-version 0706 -momit-leaf-frame-pointer -v -v -resource-dir ../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /ccvunix/cdndev/user/cdndadm/Playground/msae -ferror-limit 19 -fmessage-length 170 -mstackrealign -fno-signed-char -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o work.plist -x c++ work.cpp clang -cc1 version 3.1 based upon LLVM 3.1 default target powerpc-ibm-aix6.1.0.0 ignoring nonexistent directory "../lib/clang/3.1/include"

include "..." search starts here:

include <...> search starts here:

/usr/local/include /usr/include End of search list. work.cpp:8:10: fatal error: 'fstream' file not found

include

     ^

1 error generated.

I googled this and found that it used to be a bug in the debian distribution, but should have been fixed in release 3.0. As can be seen, I use version 3.1, but somehow it looks like it has crept in again.

Regards,

Marcel Bink

llvmbot commented 12 years ago

assigned to @tkremenek