3
我們使用以下代碼來確定編譯時是否爲clang和gcc指定了-sanitize = address。我們如何確定-sanitize = undefined是否已被指定?如何確定UBSAN是否使用clang或gcc進行了編譯?
bool isSanitized = false;
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
isSanitized = true;
#endif
#elif defined(__SANITIZE_ADDRESS__)
isSanitized = true;
#endif
你可能會檢查這個http://stackoverflow.com/questions/38719560/is-there-a-way-to-store-clang-compile-time-flags-in-the-output-binary – xhamr
這並不是' t的工作方式與ASAN檢測相同。 –