我在iOS项目中使用CocoaLumberjack吊舱。
定义自定义宏,如,
#define SM_DDLogDebugConst(tag, frmt) DDLogDebug(([NSString stringWithFormat:@"[DEBUG][%@] %@", tag, frmt]), @"%@")
在代码中,我使用了如下宏:,
int64_t startTime = [TimeUtils NOW]; // returns timestamp // line = 10
...
int64_t tempTime = [TimeUtils NOW]; // returns timestamp // line = 20
SM_DDLogDebug(TAG_Class, @"elapsed time: %lld", (tempTime - startTime));
...
问题是当我运行“推断”时
DEAD_STORE
第10行和第2行中的错误;20尽管行中的变量已用于日志记录。如何解决这个问题?
注:
我的推断命令分两步运行,
xcodebuild clean build -workspace Project.xcworkspace -scheme Main -configuration Release COMPILER_INDEX_STORE_ENABLE=NO OTHER_CFLAGS="-DNS_FORMAT_ARGUMENT(A)= -D_Nullable_result=_Nullable" | tee xcodebuild.log | /usr/local/bin/xcpretty -r json-compilation-database -o compile_commands.json
/usr/local/bin/infer run --keep-going --skip-analysis-in-path Pods --compilation-database-escaped compile_commands.json