clang++ - Using scan-build with g++ header files -
i trying run scan-build
on clang++
compilation uses gcc (5.4) tool-chain:
scan-build --force-analyze-debug-code --status-bugs -v -v -v clang++ -std=c++11 -stdlib=libstdc++ --gcc-toolchain=/my/path/gcc-5.4.0 -wall -wextra main.cpp
however, somehow scan-build
when performs header inclusion, prefers header files different directory, old gcc (4.4). errors, like:
in file included /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:60:
so, somehow path /usr/lib/gcc/x86_64-redhat-linux/4.4.7
gets injected against intentions.
i can see in verbose output clang++
command gets executed is:
'/opt/llvm-3.9.0/bin/clang++' '-cc1' '-triple' 'x86_64-unknown-linux-gnu' '-analyze' '-disable-free' '-disable-llvm-verifier' '-discard-value-names' '-main-file-name' 'main.cpp' '-analyzer-store=region' '-analyzer-opt-analyze-nested-blocks' '-analyzer-eagerly-assume' '-analyzer-checker=core' '-analyzer-checker=unix' '-analyzer-checker=deadcode' '-analyzer-checker=cplusplus' '-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-checker=nullability.nullpassedtononnull' '-analyzer-checker=nullability.nullreturnedfromnonnull' '-analyzer-output' 'plist' '-w' '-mrelocation-model' 'static' '-mthread-model' 'posix' '-mdisable-fp-elim' '-fmath-errno' '-masm-verbose' '-mconstructor-aliases' '-munwind-tables' '-target-cpu' 'x86-64' '-dwarf-column-info' '-debugger-tuning=gdb' '-resource-dir' '/opt/llvm-3.9.0/bin/../lib/clang/3.9.1' '-u' 'ndebug' '-internal-isystem' '/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7' '-internal-isystem' '/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/x86_64-redhat-linux' '-internal-isystem' '/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward' '-internal-isystem' '/usr/local/include' '-internal-isystem' '/opt/llvm-3.9.0/bin/../lib/clang/3.9.1/include' '-internal-externc-isystem' '/include' '-internal-externc-isystem' '/usr/include' '-std=c++11' '-fdeprecated-macro' '-fdebug-compilation-dir' '/login/myname/cpp/analyzer' '-ferror-limit' '19' '-fmessage-length' '0' '-fobjc-runtime=gcc' '-fcxx-exceptions' '-fexceptions' '-fdiagnostics-show-option' '-analyzer-display-progress' '-analyzer-output=html' '-o' '/tmp/scan-build-2017-09-12-073439-16989-1' '-x' 'c++' 'main.cpp'
this contains incorrect path /usr/lib/gcc/x86_64-redhat-linux/4.4.7
.
is there way correct in scan-build
uses g++ header files different path?
Comments
Post a Comment