facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.89k stars 2.01k forks source link

@protocol is using a forward protocol declaration of 'WCTColumnCoding' #1302

Open guoxiaomind opened 4 years ago

guoxiaomind commented 4 years ago

Infer version v0.17.0 MacOS Catalina 10.15.5 (19F101)

if use this command that compile pass

xcodebuild -project XXX.xcodeproj -target XXX -configuration Debug
  -sdk iphonesimulator

use this command that compile fail

infer -- xcodebuild -project XXX.xcodeproj -target XXX -configuration Debug
  -sdk iphonesimulator

error info

 error: @protocol is using a forward protocol declaration of
      'WCTColumnCoding'
    if (![propertyClass conformsToProtocol:@protocol(WCTColumnCoding)]) {
                                            ^
In file included from 
Example/Pods/WCDB/objc/WCDB/interface/declare/WCTDeclare.h:68:11: note: 'WCTColumnCoding' declared here
@protocol WCTColumnCoding;
          ^
2 errors generated.
Error: the following clang command did not run successfully:
    /usr/local/Cellar/infer/0.17.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-8
    @/var/folders/7l/sbdl85t56_9729bhtnjlt2br0000gn/T/clang_command_.tmp.ae60df.txt
  ++Contents of '/var/folders/7l/sbdl85t56_9729bhtnjlt2br0000gn/T/clang_command_.tmp.ae60df.txt':
    "-cc1" "-load"
    "/usr/local/Cellar/infer/0.17.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
    "-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
    "-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
    "-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
    "i386-apple-ios7.0.0-simulator" "-emit-obj" "-mrelax-all" "-disable-free"
    "-disable-llvm-verifier" "-discard-value-names" "-main-file-name"
    "WCTRuntimeObjCAccessor.mm" "-mrelocation-model" "pic" "-pic-level" "2"
    "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose"
    "-munwind-tables" "-faligned-alloc-unavailable"
    "-target-sdk-version=13.2" "-target-cpu" "yonah" "-dwarf-column-info"
    "-debug-info-kind=standalone" "-dwarf-version=2" "-debugger-tuning=lldb"
    "-ggnu-pubnames" "-target-linker-version" "520" "-coverage-notes-file"
    "/VCode/Example/build/Pods.build/Debug-iphonesimulator/WCDB.build/Objects-normal/i386/WCTRuntimeObjCAccessor.gcno"
    "-resource-dir"
    "/usr/local/Cellar/infer/0.17.0/lib/infer/facebook-clang-plugins/clang/install/lib/clang/8.0.0"
    "-dependency-file"
    "//Example/build/Pods.build/Debug-iphonesimulator/WCDB.build/Objects-normal/i386/WCTRuntimeObjCAccessor.d"
    "-MT" "dependencies" "-isysroot"
    "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk"
    "-iquote"

Internal Error:   /usr/local/Cellar/infer/0.17.0/lib/infer/infer/bin/../lib/python/infer.py
  -j 6 --project-root
/Modules/Example/Pods
  --out
/Modules/Example/Pods/infer-out
  -- xcodebuild -project XXX.xcodeproj -target XXX -configuration Debug
  -sdk iphonesimulator:
  exited with code 65
Error backtrace:
Raised at file "string.ml", line 145, characters 16-31
Called from file "string.ml" (inlined), line 149, characters 17-46
Called from file "src/string.ml", line 407, characters 12-33
Called from file "src/string.ml", line 416, characters 11-33
Re-raised at file "base/Die.ml", line 26, characters 8-56
Called from file "integration/Driver.ml", line 171, characters 2-16
Called from file "integration/Driver.ml", line 272, characters 6-409
Called from file "integration/Driver.ml", line 323, characters 2-29
Called from file "base/Utils.ml", line 398, characters 16-20
Called from file "scuba/ScubaLogging.ml", line 66, characters 29-44
Called from file "infer.ml", line 20, characters 2-36
Called from file "base/Utils.ml", line 398, characters 16-20
Called from file "scuba/ScubaLogging.ml", line 66, characters 29-44
Called from file "infer.ml", line 137, characters 8-54
juno12560 commented 1 year ago

any update? it seems that @protocol in open clang does not accept protocol forward declaration but it does in apple clang. is there any workaround that could avoid this error?