sql: fix -Wnull-pointer-subtraction warning
clang 13 includes a check for subtraction from NULL pointer which is considered UB: historically, we had an alignment checking macro which is affected by this. It seems like the intention of the macro's author was to implicitly cast the pointer being checked to uintptr_t without including stddef.h — replace this subtraction with an explicit cast. There is no way to set SQL_4_BYTE_ALIGNED_MALLOC, so the corresponding part of the code was removed. Now there are only 8 byte alignment assertions. NO_CHANGELOG=UB fix NO_DOC=UB fix NO_TEST=UB fix Co-authored-by:Georgiy Lebedev <curiousgeorgiy@gmail.com> (cherry picked from commit 0289433a)
Loading
Please register or sign in to comment