2017-07-17 38 views
0

我一直在嘗試使用鐺檢查靜態代碼分析。 我的生成文件生成compile_commands.json到目前爲止鐺檢查非常適用於x86平臺,但是我想使用它的ARM平臺了。 項的一個看起來是這樣的:鐺檢查用胳膊爲目標

{ 
    "directory": "/path/to/myproject/src", 
    "command": "arm-none-eabi-gcc -DBOARD_VERSION=3 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -std=gnu11 -Wall -Werror -Os -DVERSION_MAJOR=2 -DVERSION_MINOR=4 -DVERSION_PATCH=2 -I/path/to/myproject/src -I/usr/arm-none-eabi/include -MMD -MP -MF/path/to/myproject/.build/debug/src/main.d -MT//path/to/myproject/.build/debug/src/main.o -c -o /path/to/myproject/.build/debug/src/main.o /path/to/myproject/src/main.c", 
    "file": "/path/to/myproject/src/main.c" 
}, 

對於手臂同時它給了我一些通用的錯誤,這也給我相對於86的錯誤(如中斷語法):

error: x86-64 'interrupt' attribute only applies to functions that have only a pointer parameter optionally followed by an integer parameter

的clang-檢查我使用的二進制文件是Fedora發行版的一部分,但我想知道是否有辦法讓它在arm上也能正常工作?

也許一些選項(我找不到任何),也許我需要編譯一個特定的鏗鏘檢查或者也許它只是不能手臂在這種情況下有可能替代工作。

回答

1

沒關係我發現,使用:

scan-build --use-cc=$(CC) --analyzer-target=arm -o .build make clean all 

使用鐺分析過

是不錯的選擇