cmuratori / meow_hash

Official version of the Meow hash, an extremely fast level 1 hash
https://mollyrocket.com/meowhash
zlib License
1.73k stars 62 forks source link

Show a compile error if used with ASAN #83

Open norcalli opened 3 years ago

mmozeiko commented 3 years ago

This #if does not compile in MSVC: fatal error C1012: unmatched parenthesis: missing ')' I think it does not like __has_feature which expands to nothing, so && ) is syntax error. People typically do

#ifndef __has_feature
#   define __has_feature(x) 0
#endif

before using __has_feature across compilers.

Imho it is better to disable address sanitizer on function. Otherwise this will prevent users using meow hash in their project at all if they want to use asan. Do disable asan on function you use __attribute__((no_sanitize_address)) for gcc/clang or __declspec(no_sanitize_address) for MSVC