Skip to content

Instantly share code, notes, and snippets.

@dodikk
Created February 26, 2015 09:01
Show Gist options
  • Select an option

  • Save dodikk/3bf4c49fbddf88f18ffa to your computer and use it in GitHub Desktop.

Select an option

Save dodikk/3bf4c49fbddf88f18ffa to your computer and use it in GitHub Desktop.
Scan-build error
#!/bin/bash
LAUNCH_DIR=$PWD
cd ..
REPOSITORY_ROOT=$PWD
##
cd "$REPOSITORY_ROOT/app/HealthJoy"
APPLICATION_PROJECT_DIR=$PWD
APPLICATION_NAME=HealthJoy
PCH_CACHE_DIRS=```find /var/folders -name "SharedPrecompiledHeaders"```
for SINGLE_PCH_CACHE_DIR in $PCH_CACHE_DIRS; do
rm -rf "$SINGLE_PCH_CACHE_DIR"
mkdir -p "$SINGLE_PCH_CACHE_DIR"
done
rm -rf ~/Library/Developer/Xcode/DerivedData
mkdir -p ~/Library/Developer/Xcode/DerivedData
find $REPOSITORY_ROOT -name "*.pch" -exec touch {} \; -print
cd "$APPLICATION_PROJECT_DIR"
## Run static analyzer and create output for jenkins
scan-build \
--use-cc=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
--use-c++=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ \
-v -v -o $REPOSITORY_ROOT/clangScanBuildReports \
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -target healthjoy -configuration Debug -sdk iphoneos clean build
AnalyzeShallow Sentry/HJSentryChatThreadLogger.m
cd /Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/dodikk/tools/oclint-0.8.1/bin:/Users/dodikk/tools/clang-analyzer/checker-276"
/Users/dodikk/tools/clang-analyzer/checker-276/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wimplicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wfour-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wassign-enum -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wsign-conversion -D__clang_analyzer__ -Xclang -analyzer-output=plist-html -Xclang -analyzer-config -Xclang path-diagnostics-alternate=true -Xclang -analyzer-config -Xclang report-in-main-source-file=true -Xclang -analyzer-config -Xclang mode=shallow -Xclang -analyzer-checker -Xclang security.insecureAPI.UncheckedReturn -Xclang -analyzer-checker -Xclang security.insecureAPI.getpw -Xclang -analyzer-checker -Xclang security.insecureAPI.gets -Xclang -analyzer-checker -Xclang security.insecureAPI.mkstemp -Xclang -analyzer-checker -Xclang security.insecureAPI.mktemp -Xclang -analyzer-disable-checker -Xclang security.insecureAPI.rand -Xclang -analyzer-disable-checker -Xclang security.insecureAPI.strcpy -Xclang -analyzer-checker -Xclang security.insecureAPI.vfork -miphoneos-version-min=8.1 -iquote /Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/HelathJoyLogger-generated-files.hmap -I/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/HelathJoyLogger-own-target-headers.hmap -I/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/HelathJoyLogger-all-target-headers.hmap -iquote /Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/HelathJoyLogger-project-headers.hmap -I/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I../../lib-third-party/raven-objc -I../../lib-third-party -I.. -I/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/DerivedSources/armv7 -I/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/HelathJoyLogger.build/Debug-iphoneos/HelathJoyLogger.build/DerivedSources -F/Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/build/Debug-iphoneos -include /var/folders/qw/zkzcc8l12ws2ngmr6v40tch40000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/HealthJoyLogger-ckunyemkmegpsaaayceuqzlicmyq/HealthJoyLogger.pch --analyze /Users/dodikk/projects/HealthJoy-iOS/lib/HealthJoyLogger/Sentry/HJSentryChatThreadLogger.m -o /Users/dodikk/projects/HealthJoy-iOS/clangScanBuildReports/2015-02-26-104622-11583-1/StaticAnalyzer/HelathJoyLogger/HelathJoyLogger/normal/armv7/HJSentryChatThreadLogger.plist
In file included from <built-in>:180:
<command line>:4:10: fatal error: '/var/folders/qw/zkzcc8l12ws2ngmr6v40tch40000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/HealthJoyLogger-ckunyemkmegpsaaayceuqzlicmyq/HealthJoyLogger.pch' file not found
#include "/var/folders/qw/zkzcc8l12ws2ngmr6v40tch40000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/HealthJoyLogger-ckunyemkmegpsaaayceuqzlicmyq/HealthJoyLogger.pch"
^
1 error generated.
Command /Users/dodikk/tools/clang-analyzer/checker-276/bin/clang failed with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment