exchg
exchg
>Indeed, the macros NK_OFFSETOF, NK_CONTAINER_OF, NK_ALIGNOF all dereference a null pointer. Nope. Dereferencnig assumes that you will read or write some data under the pointer. Currently here is pointer arithmetic...
>So either clang-9 is reporting false positive >or either something is fishy with the code. Both are possible Common `offsetof` implementation looks like: ```c++ #define offsetof(st, m) \ ((size_t)&(((st *)0)->m))...
@rivten This is canonical `container_of` implementation, can you check it with your clang compiler? ```c++ #define OFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define CONTAINER_OF(ptr, type, member) ({ \ const typeof( ((type...
>Also I could try to setup a very minimal example public repo with everything prepared so you just have to build and run it to repro the error detection. Yep,...
@rivten checked your repo and met no problem, clang-9.0.1. Maybe you can provide some additional info? >macro that @exchg does not seem to compile in pure C99, Yep. You can...
> Compiling and running gives no UB when using the __builtin_offsetof macro Yep, i can confirm it. >but maybe this is specific for the clang compiler so I guess there...
This bug still exist. I can add from my side that looks like it's happens only when region contain an empty lines.