4

Im trying to carry out static source code analysis for my android native project written in C/C++ using scan-build. I tried the instructoins on this page(http://clang.llvm.org/get_started.html#build) for building and running scan-build. All these are done in Ubuntu 10.10, 64bit version.

Since I'm building my project in android source, the compilers used are gcc and g++ located in android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/.

It is said that I can configure scan-build to work with gcc/g++ using --use-c++ and --use-cc options. But when I run the command: (./run_scanbuild.sh is the build script)

scan-build --use-cc=/home/chulwoo/8655_GB_AU_2_30/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc --use-c++=/home/chulwoo/8655_GB_AU_2_30/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-g++ ./run_scanbuild.sh

it says :

scan-build: 'clang' executable not found in '/home/chulwoo/Clang/llvm/tools/clang/tools/scan-build/bin'.
scan-build: Using 'clang' from path: /home/chulwoo/Clang/build/Debug+Asserts/bin//clang

Seems the --use-c++ and --use-cc options are simply ignored.

Does any one know how to make scan-build work with android prebuilt gcc/g++ ? Or, is it feasible to build my project using Clang in android?

Thanks in advance. Jin.

jin
  • 1,542
  • 1
  • 9
  • 10

1 Answers1

0

Okay ,this was a stupid question.

Just build it with following command, and it surely will generate static-analysis result. Here lets assume that gcc is used for building.

scan-build gcc ...whatever you wanna give as options...

The scan-build is really a nice tool, hope you guys enjoy it.

jin
  • 1,542
  • 1
  • 9
  • 10