This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

offsetof implementation incompatible with c++

In stddef.h c6000 7.4.1

#define offsetof(_type, _ident) ((size_t)__intaddr__(&(((_type *)0)->_ident)))

doesn't work because size_t needs to be qualified with std::

The simplest fix is

#define offsetof(_type, _ident) ((__SIZE_T_TYPE__)__intaddr__(&(((_type *)0)->_ident)))