[Tarantool-patches] [PATCH small 1/1] rlist: use built-in offsetof() when possible

Cyrill Gorcunov gorcunov at gmail.com
Wed May 13 10:39:00 MSK 2020


On Wed, May 13, 2020 at 01:27:25AM +0200, Vladislav Shpilevoy wrote:
> Rlist implemented its own offsetof() as a classic NULL
> pointer cast to the target type with taking address of
> the member. So it turned into NULL + member offset.
> 
> But appeared undefined behaviour clang sanitizer is
> not friendly to this hack.
> 
> The patch makes rlist define its own offsetof only as
> a last resort.
> 
> Part of https://github.com/tarantool/tarantool/issues/4609

I think one day we should gather all such tricks and helpers
into compiler.h. Still while we didn't yet

Reviewed-by: Cyrill Gorcunov <gorcunov at gmail.com>

thanks!


More information about the Tarantool-patches mailing list