• Marko Mäkelä's avatar
    MDEV-33161 Function pointer signature mismatch in LF_HASH · a2bd936c
    Marko Mäkelä authored
    In cmake -DWITH_UBSAN=ON builds with clang but not with GCC,
    -fsanitize=undefined will flag several runtime errors on
    function pointer mismatch related to the lock-free hash table LF_HASH.
    
    Let us use matching function signatures and remove function pointer
    casts in order to avoid potential bugs due to undefined behaviour.
    
    These errors could be caught at compilation time by
    -Wcast-function-type-strict, which is available starting with clang-16,
    but not available in any version of GCC as of now. The old GCC flag
    -Wcast-function-type is enabled as part of -Wextra, but it specifically
    does not catch these errors.
    
    Reviewed by: Vladislav Vaintroub
    a2bd936c
mdl.cc 102 KB