[Tarantool-patches] [PATCH 02/10] cmake: ignore warnings on alignof() and offsetof()

Cyrill Gorcunov gorcunov at gmail.com
Mon Jun 8 15:52:18 MSK 2020


On Thu, May 21, 2020 at 10:37:25PM +0200, Vladislav Shpilevoy wrote:
> Warning about invalid offsetof() (used on non-POD types) was set
> for g++, but wasn't for clang++.
> 
> Warning about invalid alignof() (when expression is passed to it
> instead of a type) wasn't ignored, but is going to be very
> useful in upcoming unaligned memory access patches. That allows
> to write something like:
> 
>     struct some_long_type *object = region_aligned_alloc(
>             region, size, alignof(*object));
> 
> This will work even if type of 'object' will change in future,
> and so it is safer. And shorter.
> 
> Part of #4609
Reviewed-by: Cyrill Gorcunov <gorcunov at gmail.com>


More information about the Tarantool-patches mailing list