如何使用扫描构建在不同的目标上运行clang static analyzer

如何使用扫描构建在不同的目标上运行clang static analyzer,clang,static-analysis,Clang,Static Analysis,我想在不同的目标上运行clang静态分析器。以下是makefile剪报: CC = <path to clang folder>/build/bin/clang . . . src/%.o: ../src/%.c ${CC} --target=powerpc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" CC=/build/bin/cl

我想在不同的目标上运行clang静态分析器。以下是makefile剪报:

CC = <path to clang folder>/build/bin/clang
.
.
.    
src/%.o: ../src/%.c
    ${CC} --target=powerpc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
CC=/build/bin/clang
.
.
.    
src/%.o:../src/%.c

${CC}--target=powerpc-O0-g3-Wall-c-fmessage length=0-MMD-MP-MF“$(@:%.o=%.d)”-MT“$(@)”-o“$@“$”$找到了解决方案。我认为下一个参数中的ccc analyzer脚本中有一个错误:

my %CompilerLinkerOptionMap = (
  '-Wwrite-strings' => 0,
  '-ftrapv-handler' => 1, # specifically call out separated -f flag
  '-mios-simulator-version-min' => 0, # This really has 1 argument, but always has '='
  '-isysroot' => 1,
  '-arch' => 1,
  '-m32' => 0,
  '-m64' => 0,
  '-stdlib' => 0, # This is really a 1 argument, but always has '='
  '--sysroot' => 1,
  '-target' => 1,
  '-v' => 0,
  '-mmacosx-version-min' => 0, # This is really a 1 argument, but always has '='
  '-miphoneos-version-min' => 0 # This is really a 1 argument, but always has '='
);

需要

'--target' => 1,

(使用双'-')…

找到了解决方案。我认为下一个参数中的ccc analyzer脚本中存在错误:

my %CompilerLinkerOptionMap = (
  '-Wwrite-strings' => 0,
  '-ftrapv-handler' => 1, # specifically call out separated -f flag
  '-mios-simulator-version-min' => 0, # This really has 1 argument, but always has '='
  '-isysroot' => 1,
  '-arch' => 1,
  '-m32' => 0,
  '-m64' => 0,
  '-stdlib' => 0, # This is really a 1 argument, but always has '='
  '--sysroot' => 1,
  '-target' => 1,
  '-v' => 0,
  '-mmacosx-version-min' => 0, # This is really a 1 argument, but always has '='
  '-miphoneos-version-min' => 0 # This is really a 1 argument, but always has '='
);

需要

'--target' => 1,
(带双'-')