Skip to content
Snippets Groups Projects
Commit 0289433a authored by Denis Smirnov's avatar Denis Smirnov Committed by Kirill Yukhin
Browse files

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: default avatarGeorgiy Lebedev <curiousgeorgiy@gmail.com>
parent 76e09548
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment