【发布时间】:2019-04-27 05:39:23
【问题描述】:
使用 clang 的 ubsan 从 boost 1.64 版运行 gzip.hpp 代码会给出以下消息:
path/to/boost/1_64_0/include/boost/iostreams/filter/gzip.hpp:674:16: runtime error: implicit conversion from type 'int' of value 139 (32-bit, signed) to type 'char' changed the value to -117 (8-bit, signed)
#0 0x7fed40b77bc2 in boost::iostreams::basic_gzip_compressor<std::allocator<char> >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long)
我想用抑制文件来抑制它。对于其他警告,这已经奏效:
unsigned-integer-overflow:path/to/boost/*
在这种情况下,我希望这应该可以工作
implicit-integer-sign-change:/lfs/vlsi/tools/boost/*
但它在运行时给出
UndefinedBehaviorSanitizer: failed to parse suppressions
这个消毒剂标志的正确名称是什么?
另请参阅:https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions
来自https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks
-fsanitize=implicit-integer-sign-change:整数类型之间的隐式转换,如果这改变了值的符号。也就是说,如果 原始值为负,新值为正(或 零),或者原值为正,而新值为 消极的。此消毒剂捕获的问题不是未定义的行为, 但往往是无意的。
【问题讨论】: