2013-02-05 64 views
0

我有這個問題......分別使用xcodebuild聯編後successfuly建設的iOS 6.0(4.5的Xcode)項目,該sourceanalyzer第一報告失蹤.nst情侶類,包括STDARG.H和類似的文件。看起來像sourceanalyzer無法看到iPhone SDK的標題搜索路徑。然而Fortify的似乎很罕見,我沒有發現任何答案,尤其是對於各種版本的XCode等任何兼容性?使用HP Fortify的和XCode的

$ sourceanalyzer -b Forty xcodebuild -configuration Debug -sdk iphoneos6.1 

輸出:

Build settings from command line: 
SDKROOT = iphoneos6.1 

=== BUILD NATIVE TARGET fortifyTest OF PROJECT fortifyTest WITH CONFIGURATION Debug === 
Check dependencies 

ProcessPCH  /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.pth fortifyTest/fortifyTest-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler 
cd /Users/sychram/Repositories/fortifyTest 
setenv LANG en_US.US-ASCII 
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Applications/HP_Fortify/HP_Fortify_SCA_and_Apps_3.70/bin" 
/Users/sychram/.fortify/sca5.14/build/Forty/build717537620538182813/clang -x objective-c-header -arch armv7 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=6.0 -iquote /Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-generated-files.hmap -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-own-target-headers.hmap -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-all-target-headers.hmap -iquote /Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-project-headers.hmap -I/Users/sychram/Repositories/fortifyTest/build/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/DerivedSources/armv7 -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/DerivedSources -F/Users/sychram/Repositories/fortifyTest/build/Debug-iphoneos --serialize-diagnostics /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.dia -c /Users/sychram/Repositories/fortifyTest/fortifyTest/fortifyTest-Prefix.pch -o /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.d 
[error]: Translator execution failed. Please consult the Troubleshooting section of the User Manual. 
Translator returned status 1: 

In file included from /Users/sychram/Repositories/fortifyTest/fortifyTest/fortifyTest-Prefix.pch:12: 
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9: 
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8: 
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: 
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11: 
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/sys/types.h:78: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/machine/types.h:35:10: fatal error: 'i386/types.h' file not found 
#include "i386/types.h" 
    ^
1 error generated. 
+0

請您提供更多關於此軟件的工作原理的更多信息?我是否必須在我的Mac上安裝此軟件,或者必須將我的源代碼上傳到Fortify門戶網站。我正在尋找適用於iOS應用程序掃描的Fortify靜態代碼分析器。 – harshit2811

+0

Fortify的是用Java編寫的應用程序,可以在Linux/MAC/Windows上運行。它需要和使用底層構建系統(基於ant,maven,cmake,xcode等)的靜態代碼分析器。還有一項名爲HP Fortify 360的服務,即SaaS,您可以將代碼上傳到第三方(Fortify)門戶網站。惠普已經出售Fortify,因此它的未來還不清楚。您也可以嘗試Checkmarx(也是SaaS)。 – igraczech

回答

0

AFAIK只版本的Xcode 4.1,4.2,4.2.1,4.3是通過在最新版本3.7支持設防。

+0

項目中包含的前綴頭文件,系統框架(UIKit,Security ...)都不會被複制到/ ObjC /文件夾。 – igraczech

+0

+1 greencrizz,4.3.3失敗,4.3.0作品。這將需要更大的錘子和一些在蘋果和惠普大喊大叫。 Fortify 3.7非常適合分析2年前的項目,而不是未來應該發佈的應用程序。 – igraczech

+0

同樣在這裏,但我們已經開放了一個增強請求來推動這一點。是的,你對掃描舊項目是正確的。 – greencrizz

0

目前,對於Xcode的4.6與SCA 4.02版本的支持。但我仍然在等待的Xcode 5.x的由設防支持,我將能夠掃描基於iOS7應用。因爲提交給App Store的2月份應用程序必須使用最新版本的Xcode 5進行編譯,並且必須針對iOS 7進行優化。

+1

已經有Fortify靜態代碼分析器6.00.0096支持Xcode 5和iOS 7項目(Obj-C 2.0語法,前綴等) – igraczech

+0

感謝您的信息,那麼我將不得不重新檢查我的蘋果電腦。我認爲當我發佈sourceanalyzer命令時有一個警告。 – greencrizz

+0

你能否提供更多關於這個軟件如何工作的信息?我是否必須在我的Mac上安裝此軟件,或者必須將我的源代碼上傳到Fortify門戶網站。我正在尋找適用於iOS應用程序掃描的Fortify靜態代碼分析器。 – harshit2811